cloud goes social

Icon

computer, travel, movies, music, cuisine and more

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

Category: Code, tips & howtos

Tagged: , ,

10 Responses

  1. 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

  2. Bruce says:

    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?

  3. sachin says:

    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?

    • Cloud says:

      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:

      Image Width: 320 Image Length: 460
      Resolution: 72, 72 pixels/inch
      Bits/Sample: 16

      After using the above function:

      Image Width: 320 Image Length: 460
      Resolution: 72, 72 pixels/inch
      Bits/Sample: 8

      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

  4. sachin says:

    sorry to disturb you on a holiday but just got to get it running today.

  5. sachin says:

    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

  6. sachin says:

    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.

    • Cloud says:

      @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

  7. sachin says:

    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.

Leave a Reply

Donate

If you appreciate my work, my applications, this blog in general or you simply feel like rewarding me for something please consider donate.
Any amount will motivate me in keeping up with the blog and the applications.


Thank you!

Donors

F. Olsen, W. Chang, W. Edmondson, C. Sharff, M. Brown, G. Helton, J. de Ruiter, K. Langner, K. Smith, T. OHalloran, B. Zabarauskas

Listening to ...