I have jpeg image on the server from IP camera. This is every 1-second snapshot. Because of privacy, I need to cover the closest balcony.

enter image description here

I was prepared a cover png image. Is it possible to make a shell script to merge images? Exactly on yourself or using pixel coordinates? Input file is jpeg, the cover is png, output file must be jpeg.

enter image description here

enter image description here

  • 2
    I don't understand why downvote. I would recommend to you use blur from console with imagemagick: imagemagick.org/Usage/mapping/#blur. Hopes it's helpful for you. – Yurij Goncharuk Apr 6 '18 at 13:56
  • Please, let me know if it helpful for you. – Yurij Goncharuk Apr 6 '18 at 13:58
  • Thank you, that's exactly what I am looking for, but it will be a lot of effort and work to understand how it works because I never use this tool. – Oldřich Švéda Apr 6 '18 at 14:24
  • It's not difficult. I used this tool about 2 years ago but for another tasks. I'm glad to listen this tool is helpful. – Yurij Goncharuk Apr 6 '18 at 14:30

For using blur feature, you should create black&white image with same size as source image (black hold image untouched, white-blure).

Black&white image: enter image description here


convert main.jpeg blur2.png -compose blur -define compose:args=10 -composite main_blured.jpeg

compose:args=<arg>    opacity of bluring

Result image: enter image description here

Also it's possible to solve this issue with -flatten feature:

convert main.jpeg -page +275+580 blur.png -flatten main_blured.jpeg

-page +275+580     start position of "blurring"/flattening image main.jpeg

Result image is (it's possible play with position coordinates for more clear image):

enter image description here

  • Thank you Yurij. I must use blur function. This image is in sunny day and daytime. At night, the image looks different. I'm currently installing virtual server and go to try it. – Oldřich Švéda Apr 6 '18 at 20:32
  • You are genius. Thank you. All works. It takes some time to process, but I reduce camera to download to 5 seconds. – Oldřich Švéda Apr 6 '18 at 21:27
  • 1
    You are welcome. It was interesting task. Thanks for that too! – Yurij Goncharuk Apr 6 '18 at 21:36
  • I have my mistake, cron was run every one minute another infinite loop, the server is overloaded. Currently, everything looks OK. See kamery.lemo.cz/masarykova – Oldřich Švéda Apr 6 '18 at 23:20
  • Nice picture! Great work! All seems OK. Thanks again for interesting task! – Yurij Goncharuk Apr 6 '18 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.