Changing CMYK to RGB

  • Thread starter Jason Gastrich, B.A., M.A.
  • Start date
J

Jason Gastrich, B.A., M.A.

Hey friends,

Does anyone know how to change 1,000 .jpg files from CMYK to RGB? I've
found a program that will do it one by one. However, I need to convert
1,000 of them, so this will take a long time unless I either find the right
program or use some sort of batch process.

Any input is appreciated.

Sincerely,
Jason

--

Jesus Christ Saves Ministries
http://www.jcsm.org
Over 50,000 web pages!

John 8:36 reads, "Therefore if the Son makes you free, you shall be free
indeed."

Galatians 5:1 reads, "Stand fast therefore in the liberty by which Christ
has made us free, and do not be entangled again with a yoke of bondage."
 
T

Toby A Inkster

Jason said:
Does anyone know how to change 1,000 .jpg files from CMYK to RGB? I've
found a program that will do it one by one. However, I need to convert
1,000 of them, so this will take a long time unless I either find the right
program or use some sort of batch process.

Perl's Image::Magick module?

Perhaps someting similar in PHP?
 
H

Hywel Jenkins

Hey friends,

Does anyone know how to change 1,000 .jpg files from CMYK to RGB? I've
found a program that will do it one by one. However, I need to convert
1,000 of them, so this will take a long time unless I either find the right
program or use some sort of batch process.

http://www.irfanview.com/ has batch conversion facilities. Not sure
about the CMYK think but it's worth a look, and it's free.
 
T

Toby A Inkster

Jason said:
Thanks. Is this a free program?

Yes. Of course, I assume some knowledge of a scripting language (such
as command-line Perl or PHP) for automation purposes. Your script would
need to get a list of files to be converted, loop through them and for
each file:

- think up a name for the new file. (e.g. for myfile.jpeg, the
new file name might be myfile-rgb.jpeg)

- call ImageMagick using either a language-specific module, or
(easier) a system() call to run:
convert -colorspace RGB myfile.jpeg myfile-rgb.jpeg

- optionally, delete the original.

ImageMagick homepage:
<http://www.imagemagick.org/>
 
J

Jason Gastrich, B.A., M.A.

Toby said:
Yes. Of course, I assume some knowledge of a scripting language (such
as command-line Perl or PHP) for automation purposes. Your script
would need to get a list of files to be converted, loop through them
and for each file:

- think up a name for the new file. (e.g. for myfile.jpeg, the
new file name might be myfile-rgb.jpeg)

- call ImageMagick using either a language-specific module, or
(easier) a system() call to run:
convert -colorspace RGB myfile.jpeg myfile-rgb.jpeg

- optionally, delete the original.

ImageMagick homepage:
http://www.imagemagick.org/

I affrim that a batch script could be used with a variety of programs. This
is a bit over my head, though. Is there an article on this?

JG
 
Z

Zak McGregor

On Wed, 05 Nov 2003 08:37:45 +0200, Jason Gastrich, B.A., M.A. <"Jason
Hey friends,

Does anyone know how to change 1,000 .jpg files from CMYK to RGB? I've
found a program that will do it one by one. However, I need to convert
1,000 of them, so this will take a long time unless I either find the
right program or use some sort of batch process.

Image Magick is your friend.
Ciao
Zak
 
Z

Zak McGregor

On Wed, 05 Nov 2003 08:37:45 +0200, Jason Gastrich, B.A., M.A. <"Jason

Image Magick is your friend.

Sorry I should elaborate a bit. Install ImageMagick. If you have a
reasonable shell, you can cd to the directory in which the images are
stored, and issue a command like
for i in *.jpg ; do convert -colorspace rgb -quality 100 $i $i.rgb.jpeg ;
done

convert is merely one of the tools provided by the ImageMagick suite.

Ciao

Zak
 
M

Markus Ernst

Jason Gastrich said:
Hey friends,

Does anyone know how to change 1,000 .jpg files from CMYK to RGB? I've
found a program that will do it one by one. However, I need to convert
1,000 of them, so this will take a long time unless I either find the right
program or use some sort of batch process.

Adobe Photoshop has a nice batch function. You can record an action, start
the batch process on the image folder and go for lunch.
 
A

Andy Dingley

Forget it, he uses Windows.

Windows has a great shell, it's called Perl :cool:

Actually, for simply iterating a directory full of files, you could do
it perfectly well in DOS ! The trick is to do it in two batch files,
one with the loop in and one with the command. Parameter or variable
handling in DOS / Windows shell is negligible, but there's just about
enough to work with if you use the command-line parameters (hence the
need to use two batch files).
 
Joined
Nov 5, 2008
Messages
1
Reaction score
0
Batch file to convert CMYK files to RGB

I installed ImageMagick for Windows.

Here's a batch file which checks for CMYK .jpg and convert it to RGB .jpg.
The original file is kept and the RGB version of the original file has the same name with -rgb added to it.

---

@echo off
for /F "delims=" %%I in ('dir /B /S *.jpg') do call :process "%%I"
goto :eof

:process
identify -verbose %1 | find /c /i "Colorspace: CMYK" > temp.txt
set /p count=<temp.txt
del temp.txt
if %count%==1 (
if not exist "%~dpn1-rgb.jpg" convert -quality 90 -colorspace RGB %1 "%~dpn1-rgb.jpg"
)
goto :eof
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top