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

ImageMagick on iPhone – Benchmarks

Thanks to Karl (see previous post comments and update) the XCode project has now the possibility to work on the images uncompressed. We (me and Karl) wanted to see the difference for ImageMagick to work with a compressed format (JPEG, for instance) and with an uncompressed format (raw data).

I’ve added to the project a simple benchmark, consisting in running the MagickWand creation, filtering and destruction a given number of times (customizable in the beginning of the source file, for instance 10), calculating how long it takes each time and in total.

The results are impressive, and can be better exaplined by looking at this simple graph:

Benchmarks running on the simulator and on the device

Benchmarks running on the simulator and on the device (click to see better!)

As you can see working with uncompressed data achieves 3x faster results on the iPhone device, with a mean running time of 0.85 seconds to run an ordered posterize filter on an image of size 320×460 (the size of the iPhone screen). Similar results are also on the Simulator achieving 3.7x faster filtering for the same image.

The end line is trivial, working with uncompressed data, while being less easy (but as you can see from the project code not extreme) or intuitive yields much faster results!

You can download a better looking graph and the IM_test project as usual.

For any comment don’t hesitate to write, as you’ve seen I try to pick up my comments as much as I can (even on holiday!)

Thanks goes again to Karl who’s has the idea of working with raw images, and provided with the code to achieve so.

ciop ciop

ImageMagick on iPhone – Xcode

UPDATE: iOS4.3 and Xcode4

PLEASE READ THE UPDATE

UPDATE! (30.08.09)
Thanks to Jon Kean (see comments) the downloadable project now shows how to use images with unusual number of bits per component. As usual look at the defines at the top to check the functionality you want.

UPDATE! (14.07.09)
Thanks to Karl (see comments) the downloadable project now shows different ways of integrating ImageMagick with Objective-C UIImages offering both compressed methods, using JPEG compression as an example, and raw-data methods. Look at the define at the top to change which method the program will be using.

Many of you have asked me if I could post an Xcode project example to use the libraries and ImageMagick, and so, here it is.

The code is self-describing so I didn’t comment it much, it’s just a few functions call. All it does in this case is loading an image from an UIImage (Objective-C) into a format that ImageMagick (C) understands and can manipulate. Then it applies an ImageMagick filter (OrderedPosterize), which uses a configuration file (thresholds.xml).

Everything is working fine, and you have the complete set of libraries, headers and configuration files, and a configured XCode project right at hand.

All downloadable from here

If you still have any problem, don’t hesitate to contact me!

ciop ciop

ABOUT

CLOUD GOES SOCIAL is the personal blog of Claudio Marforio.
He holds a MSc in Computer Science with focus on Information Security granted by ETH Zurich. He is currently a PhD Student in the System Security Group of ETH Zurich

Categories

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