- -> convert cmyk.tif -profile USWebCoatedSWOP.icc -profile sRGB.icm im_rgb.miff
-> wand
-> compare -metric rms im_rgb.miff im_rgb.png test.miff
0 dB
1024,701,MIFF
Code: Select all
#include <stdio.h>
#include <wand/magick-wand.h>
int main()
{
ExceptionInfo
*exception;
MagickWand
*wand;
unsigned char
*profile;
size_t
length;
MagickWandGenesis();
wand=NewMagickWand();
MagickReadImage(wand,"cmyk.tif");
profile=MagickRemoveImageProfile(wand,"ICC",&length);
if (profile == (unsigned char *) NULL)
(void) printf("%s: does not have a ICC color profile\n","cmyk.tif");
exception=AcquireExceptionInfo();
profile=FileToBlob("USWebCoatedSWOP.icc",~0UL,&length,exception);
MagickSetImageProfile(wand,"ICC",profile,length);
profile=FileToBlob("sRGB.icm",~0UL,&length,exception);
exception=DestroyExceptionInfo(exception);
MagickProfileImage(wand,"ICC",profile,length);
MagickWriteImage(wand,"im_rgb.png");
MagickWandTerminus();
return(0);
}