Batch replace image color

I have plenty of images made up with the same color, just like those:

First imageanother image

Now what I want is to change their “main” color from “#3d507d” to “#7C0A0A”.

I tried to do that by changing the “hue/saturation” but with no success.
(batch changing the hue/saturation is available with this gimp script
:http://registry.gimp.org/node/23499 )

So, how can I change the color from “#3d507d” to “#7C0A0A” ? preferably with batch/scripting option?

I use GIMP / Inkscape / Photoshop.
I prefer explanations in this order (most preferred GIMP)

BTW, I don’t want to change only the “#3d507d” pixels, I want to change also the “gradiented”/”Edged”/”partly transparent” pixels to match the change to “#7C0A0A”. – in other words – It should be looking good…
Thanks.

Answer

BTW, I don’t want to change only the “#3d507d” pixels, I want to change also the “gradiented”/”Edged”/”partly transparent” pixels to match the change

I am not entirely sure what data you have, but if you happen to have SVGs (or another vector format), the problem with partial pixels does not arise, as there are no pixels in the first place. In this case you can make use of SVGs having a plain source and perform the replacement with a simple search-and-replace script. For example, on a unixoid system the following command should do your replacement on all SVGs in the current folder:

sed "s/#3d507d/#7c0a0a/g" *.svg

Note that this is modulo capitalisation, so you might need to replace #3d507d with #3D507D.

Attribution
Source : Link , Question Author : yossico , Answer Author : Wrzlprmft

Leave a Comment