dongou2019 2015-06-18 09:57
浏览 48

在php中的单个图像中添加多个图像?

Current Situation I have a single image (say original image), eight other small annotation images (say A,B,C....). I have a JSON in my database which stores the position of my annotation images. Any annotation image can be used multiple times.

My requirement I have to add annotation image on my original image. The annotation image can be added upto 1000 times with different coordinates (means 8 images need to be added 1000 times on my original image).This final image will be sent in a email with further business logic.

What i have currently implemented and my issue I am trying to add single annotation on my original image, then saving it, then opening it again, then adding another annotation, and this cycle repeats 1000 times. This slows down my Azzure server and hangs it and takes upto 8 minutes for my mobile users to get response. As php does not support multi threading i need to generate this image (with 1000 annotations) in a single cron and hence it delays my response for the request.

Algorithm that i have implemented Let me explain you whole flow how it is working now..

I have one image of apartment and i assign one task to my worker on particular x-y coordinate of image. when i assign task 1 i create one image with no 1 and set on original image of apartment on that particular x-y coordinate and generate new image with added that annotation no 1 .

Now assume i assigned 1000 task to that single worker so same process will repeat 1000 time and total 2000 images generate.

let me know if still you are not getting or any query.

Thanks in advanced

  • 写回答

1条回答 默认 最新

  • duanlie7447 2015-06-22 10:17
    关注

    I really don't understand this confusing question, but I think I can contribute towards an answer. Loading, annotating and resaving any image 1,000 times will firstly take forever, and secondly, if it is lossily encoded, destroy the quality.

    I think the correct way to do this is to create an MVG script with ALL the commands in it and run the script once to load the image a single time, apply the 1,000 edits and then resave it once.

    As you have no concrete examples, or images, all I can do is point you to here and hope you can see what I mean. Basically you will create a script that contains a line like this for each paste of each image onto the original:

    image src-over x1,y1 'image1.jpg'
    image src-over x2,y2 'image2.jpg'
    ...
    
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?