Search code examples
imagecolorspixelediting

Change Pixel Values of Image to remove Date


What is the most efficient technique to remove the date that a Camera embeds on any image it takes.

The task is to prepare a script/code/software that shall remove the date from the given input image file (jpeg, png).

Please let me know an optimum way to accomplish this.

Thank you.


Solution

  • Here is an alternative approach to the question. You can determine the average colour of the bottom right corner of the image (size 250px wide x 100px high) with Imageagick like this:

    ave=$(convert sign.jpg -gravity southeast -crop 250x100+0+0 -scale 1x1 -format "%[pixel:p{0,0}]" info:)
    

    That will give you the value srgb(199,181,119) for this image. Now you can create a rectangle (200px x 50px) that colour and overlay it onto the image and then blur the edges a little to blend it in:

    convert sign.jpg \( -size 200x50 xc:"$ave" \) -geometry +970+780 -composite -region 240x90+950+760 -blur 0x10 out.jpg
    

    enter image description here