2

I've an entire tree with PNG images

I need to - open - assign sRGB profile - close

to every of them

(about 2000 images)

Is there a way to do this via gimp 2?

realtebo
  • 23,922
  • 37
  • 112
  • 189
  • It could be done via GIMP scripting - but if the only task you will perform is this one, maybe imagemagick is more handy, as per @aneroid's answer – jsbueno Aug 27 '12 at 19:18
  • could you write me down an example of something like for each (folder) for each (subfolder) for each (photo) open(photo) assignRgb close I never used GIMP scripting – realtebo Aug 29 '12 at 14:32
  • I've not a linux machine ... sorry ... – realtebo Aug 29 '12 at 14:35

1 Answers1

4

You could use imagemagick to do this. Example:

convert rgb_image.jpg +profile icm \
        -profile sRGB.icc  -profile USCoat.icm cmyk_image.jpg

mogrify is the standard command iirc. And here's an example doing a similar thing:

FOR /R %%a IN (*.jpg) DO mogrify -profile sRGB.icc "%%a"

Linux/bash recursive directory loop examples:

for f in $(find /tmp -name '*.png'); do mogrify $f ... ; done

(replace the ... with your mogrify command, $f is the file)

Community
  • 1
  • 1
aneroid
  • 12,983
  • 3
  • 36
  • 66
  • 1
    Imagemagick is **[available on Windows](http://www.imagemagick.org/script/binary-releases.php#windows)** too. The first FOR is a windows loop, the second is in linux. Structure of Windows version of that command is: `FOR /R %%a IN (*.png) DO mogrify -profile sRGB.icc "%%a"`. The convert will also be available on both. – aneroid Aug 29 '12 at 23:12
  • 1
    You might want to mention that `mogrify` will convert the file in-place, i.e. *override* the original file, unless one uses the `-format` option to pick a different file suffix. Source: https://www.imagemagick.org/script/mogrify.php – balu Feb 18 '17 at 21:46