Search the Community
Showing results for tags 'image magick'.
Hi, This is another of my 'lessons learned' posts that may be of use to someone attempting a similar endeavour. After countless hours and a lot of help, I have managed to get an AIR Native Extension incorporating simple Image Magick functionality working. Although, so far at least, I have not achieved my ultimate objective, I do have an AIR native extension incorporating simple Image Magick functionality working on my PC. The 'ultimate objective' was to create a Windows exe file/application which could be installed on anyone's PC without the need for that PC to have Image Magick also installed - that has so far eluded me, but if that PC has Image Magick installed in the manner necessary, then the application will indeed work on another PC. The basic development process is as follows: 1) build a dll which has both Image Magick and AIR native extension connectivity (I used MS Visual C++ 2010 Express Edition as my IDE). 2) build a library (I used Flash Builder 4.6) incorporating a class and then from that build an ane file. 3) build a Flash Builder AS3/Flex project to use the functionality developed in steps 1 and 2 which incorporates the ane file from step 2. Detailed guidance for the AIR bits can be found at http://easynativeextensions.com/windows-tutorial-introduction/ which did not exist when I started this endeavour but many thanks to Radoslava Leseva for her invaluable help in this bit. I used the Wand interface to Image Magick and guidance on that can be found at http://members.shaw.ca/el.supremo/MagickWand/ and http://www.imagemagick.org/discourse-server/viewtopic.php?t=11757 The application, via a simple user interface (UI - step3), allows the user to select a jpg image file for downsizing. The UI also requests a new pixel size parameter as well as a jpg quality/compression factor. The class (step 2) has an instance constructor and a method. The UI calls the method passing it the full path name of the jpg image file to be downsized as well as the size and quality parameters. The method then calls a resize function in the dll which in turn uses the Image Magick Wand interface to do the actual resizing. I know that there are easier ways to downsize a jpg image but I wanted to learn how to develop an AIR native extension! I am impressed with the quality of the downsized images. As a test I downsized an 18Mb high quality image to a file about 150Kb in size and on my 24 inch screen I cannot detect any reduction in the visual quality of the image. That of course is due to the Image Magick functionality. I hope that this may be of help to someone! Cheers from Oz.
Hi, I thought that I'd post another of my 'lessons learned' - this time interfacing between a C++ dll (though I suppose it doesn't need to be a dll) and Image Magick. After much Googling it seems that there are 3 ways for a C++ program to invoke Image Magick functionality: 1) via the 'core' C API 2) via Magick++ 3) via Wand In my case I only wanted basic Image Magick functions. I eventually found a nice simple example which showed the difference between approach 1) and approach 3). Approach 3 - i.e., via Wand was far simpler. I could not get approach 2 to work for me at all but I'm sure that someone knowledgeable could. So I proceeded to experiment with the Wand interface. I am using Visual C++ 2008 Express Edition as my IDE. There is some very good advice re the settings that you need to make in the IDE so that the compiler and linker can find the files they need - see http://www.imagemagick.org/discourse-server/viewtopic.php?t=11757 and in particular el_supremo's post dated 2008-07-26T08:05:28-07:00. My C++/Wand code just reads in a jpg image file, sets size and quality parameters and then writes the resized file out with its new size and quality and a new file name, all using Wand methods. It took me about 3 weeks and hundreds of Google searches to get to this outcome, or maybe I'm just a slow learner :-) Cheers from Oz.