Jul 28, 2009
ImageMagick on iPhone – update with TIFF
UPDATE: iOS4.3 and Xcode4
PLEASE READ THE UPDATE
Here I go again with an update to the ImageMagick on iPhone saga.
As requested by a few people here on the site, I’ve added TIFF functionality to the compiled library. If you’re interested in reviewing the all process to compile ImageMagick for the iPhone please refer to my two previous posts where that’s described in detail: first and second.
TIFF is compiled with ZIP functionality, so you can compress your TIFF files.
As usual I’ve provided you with an updated script which now enables the compilation of tiff-3.8.2 alongside jpeg and png to have it supported in ImageMagick.
For the lazy there’s always the compiled static libraries and includes. But remember to take as well the *.xml configuration files for some ImageMagick functionality!
And the IM_Test Xcode project has been updated as well where the TIFF functionality is tested.
I guess I’ve updated everything accordingly. Please let me know if anything isn’t working for you. As usual contacting me here on the site.
ciop ciop
Hey
I was just playing around with image processing stuff
i need to implement the following functions :
Tint
Blur
Contrast
Brightness
GreyScale
Sharpness
I found many funtions in effects file
but problem is im getting no wat to call the function properly and get an result image to be shown in UIImageView.image
my C is intermediate so :D going through large chunk of header files is making me feel blue
please help :(
regards
Hardik
Please look at the downloadable sample project to apply an effect to an image. As for different effects you should scan the API documented over at http://www.imagemagick.org/api/MagickWand/index.html
Hey, thanks for the good work.
I am trying to figure out how to use magickwand to create an animated gif from a sequence of images. I have been unable to find documentation on how to do this. Could you give me a nudge in the right direction?
I am using the image we get using UIPickerViewController which is one we get when we select from photo album and processing it like you said . The size of image is 320×320 and its 64bpp . how can i manipulate this using imagemagick to het a larger image say 640×640 and 1×1 pixel or 4×4 .
or is ther another workaround?
If you just want to change the bpp of an image I guess you should use the MagickSetImageDepth() method of MagickWand.
In particular:
MagickSetImageDepth(MagickWand *wand, const unsigned long depth);
I tested it and before tiffinfo (use it to check your tiffs) reported:
After using the above function:
Let me know if this was what you were looking for. Also remember that for using images in Tesseract I think it’s better if they are grayscaled. Just a thought.
ciop ciop
sorry to disturb you on a holiday but just got to get it running today.
thanks a lot cloud
it worked
stuck at another place
tesseract reads image that are 1,2,4,5,6,8 bytes per pixel
the image processed by Imagemagick is 64 bits per pixel
so i get an error
1,2,4,5,6,8 bpp are supported:64
How do i go about this.
is there a way to change this in ImageMagick
i am basically trying to process the image generated using tesseract
no tesseract reads only tif files so am stuck there
please help me soon.
@sachin: Sorry for the delay, but I’m still on holiday. So, I tried your code and it’s perfectly working. What I’d suggest you to do is to download the XCode project, updated, which has TIFF support. You can find it here.
It can very well be that it’s because of configuration files, which you will find inside the project in case you need them.
In particular you can try to put this code in the file: IM_TestViewController.m at line 146:
MagickSetFormat(magick_wand,"tif"); const char * filename="/Users/CHANGETHIS/Desktop/testimage.tif"; status = MagickWriteImage(magick_wand,filename); if (status == MagickFalse) { ThrowWandException(magick_wand); }To me it’s working fine and I get a readable .tif image.
Please let me know if it’s not working for you, and what happens (in particular the status should be false and you should get an exception).
ciop ciop
thanks a lot cloud .
this was of great help
i have a problem
I am trying to write an image in tif format
here is code i am using
……
MagickBooleanType status = MagickConstituteImage(magick_wand, width, height, map, CharPixel, bytes);
MagickSetFormat(magick_wand,”tif”);
const char *filename=@”/testimage.tif”;
status=MagickWriteImage(magick_wand,filename);
it generated file .tif is not readable
however if i use
MagickSetFormat(magick_wand,”jpg”);
const char *filename=@”/testimage.jpg”;
status=MagickWriteImage(magick_wand,filename);
the generated jpg file is readable and works well
it works well with bmp 2 .
where am i going wrong.
can you help me out in this.
a quick reply will be appreciated.