I´m developing a little C program using C wand. I´m use to C, but I´m new in IM. I´ve been reeading IM documentation and lots of messages here, but didn´t get anywhere. My program has to read an image, aply an ICC profile and save it in dpx log 10 format. Now is working, but not completely ok. My questions are:
1- How I aply the ICC profile? I´ve been reading, but did´t got anything clear. Should I use MagickSetImageProfile or MagickProfileImage? what are this parameters const void *profile and const size_t length? My profile is in an .icc file.
2- I´m setting some dpx attributes using things like MagickSetOption(magick_wand, "dpx:television.gamma","1.6"), but others (included in http://www.imagemagick.org/script/motio ... properties) doesn´t work. like dpx:television.white_level or dpx:file.version.
I´m using ImageMagick 6.5.1 Q16 in windows, i put the important part of my code (very similar to IM examples). If anyone could help me i would be very grateful!
Code: Select all
// Initializate and open the image
magick_wand=NewMagickWand();
MagickReadImage(magick_wand, argv[1]);
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse){
//This operations works ok
MagickNegateImage(magick_wand, MagickFalse);
MagickAdaptiveResizeImage(magick_wand, atoi(Ancho), atoi(Alto));
MagickFlipImage(magick_wand);
MagickSetOption(magick_wand, "dpx:television.gamma","1.6");
MagickSetOption(magick_wand, "dpx:film.frame_id","scn_12023");
// This doesn´t work
MagickSetOption(magick_wand, "dpx:television.white_level","95");
MagickSetOption(magick_wand, "dpx:television.black_level","685");
MagickSetOption(magick_wand, "dpx:file.version","v0.1");
//MagickProfileImage(magick_wand, "ICC", "img/AdobeRGB1998.icc", profile);
//MagickSetImageProfile(magick_wand, "ICC", "img/AppleRGB.icc.icc", profile);
}
status = MagickWriteImages(magick_wand,argv[2],MagickTrue);
if (status == MagickFalse)
printf("error al escribir la imagen");
magick_wand=DestroyMagickWand(magick_wand);