Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Hi - I have a RGB TIF which I want to convert to use CMYK. Everything appears to work well but the Python Imaging Library (PIL) chokes on the output. Before I dig too far into PIL I'd like to be sure I'm doing the right thing when making the conversion from an ImageMagick point of view.
I do two different steps to convert the TIF from RGB to CMYK. In step1 I provide a CMYK profile to swop for the RGB one. In Step2 I flatten the TIF and then use TIFFSET to explicitly set some headers which are otherwise missing.
What I'd be grateful to know is from an Imagemagick point of view does it seem I'm doing 'the right thing' ? Or is there something obviously wrong which would upset most right thinking TIF readers !
STEP 1 (in windows .BAT form)
==========================
@echo off
set ICCCOLPROFDIR=C:\Adobe_ICC_Profiles_bundler
set IMGINPUTDIR=C:\20091130
set IMGOUTPUTDIR=C:\20091130\OutputImages
set CONVERTEXE=C:\ImageMagick\convert.exe
@echo off
REM Convert the TIFF Produced directly from the ZendGraph output
set INPUTFILE=ZENDGraphOutput.TIFF
set OUTPUTFILE=ZENDGraphOutput-Step1.TIF
@echo on
%CONVERTEXE% %IMGINPUTDIR%\%INPUTFILE% +profile icc -profile %ICCCOLPROFDIR%\RGBProfiles\AdobeRGB1998.icc -profile %ICCCOLPROFDIR%\CMYKProfiles\USWebCoatedSWOP.icc -strip %IMGOUTPUTDIR%\%OUTPUTFILE%
@echo off
@echo off
set CONVERTEXE=C:\ImageMagick\convert.exe
set IMGDIR=C:\20091130\OutputImages
set TIFFSETEXE=C:\bin\installed\GnuWin32\bin\tiffset.exe
@echo off
REM Convert the TIFF Produced directly from the ZendGraph output
set INPUTFILE=ZENDGraphOutput-Step1.TIF
set INTERMEDIATEFILE=ZENDGraphOutput-Step2.TIF
@echo on
%CONVERTEXE% %IMGDIR%\%INPUTFILE% -flatten +matte %IMGDIR%\%INTERMEDIATEFILE%
@echo off
%TIFFSETEXE% -s 305 Banana %IMGDIR%\%INTERMEDIATEFILE%
%TIFFSETEXE% -s 296 2 %IMGDIR%\%INTERMEDIATEFILE%
%TIFFSETEXE% -s 282 96 %IMGDIR%\%INTERMEDIATEFILE%
%TIFFSETEXE% -s 283 96 %IMGDIR%\%INTERMEDIATEFILE%
@echo off
Just answering my own post here for the sake of future readers. It turns out that in using the 16 bit ImageMagick I was ending up with 16-bit/channel which the Python Image Library didn't like.