Showing posts with label ImageMagick. Show all posts
Showing posts with label ImageMagick. Show all posts

Wednesday, September 28, 2011

ImageMagick for Mac OS X Lion: Install from Source / Unix

ImageMagick: Install from Source

I had to choose this way, as the binary release left me with an "identify" utility, that didn't even properly recognize a JPEG file.


And fink currently doesn't support ImageMagick for Lion.

My little differences:
  • export MAGICK_HOME="/usr/local/ImageMagick"
  • ./configure --prefix=$MAGICK_HOME
  • the ldconfig command is not available on OS X resp. Lion, and apparently it's also not necessary to run that step (on OS X resp. Lion)

And I am also putting ${MAGICK_HOME}/… in front of all the PATH… variables, i.e. before fink's GraphicsMagick's replacement wrappers for ImageMagick, that aren't really able to replace ImageMagick functionality for me.

Actually "1 out of 48" tests failed with "make check", but otherwise this software rather runs:


FAIL: Magick++/tests/attributes.sh (exit: 139)
==============================================


./Magick++/tests/attributes.sh: line 20: 42477 Segmentation fault: 11  ${MEMCHECK} "./${executable}" 2>&1 > $outfile

Wednesday, September 21, 2011

Fink - Package imagemagick – Mac OS X 10.7 aka Lion not yet supported

Fink - Package Database - Package imagemagick (Image manipulation tools): "imagemagick-6.5.8.10-1"

ImageMagick, OS X, Xcode, fink, dependency hell

After setting up Xcode on Lion properly yesterday and re-installing fink, I am now going through a dependency hell. I hope, everything will recompile smoothly – but you just never know.
As cautious as I usually am, I renamed fink's /sw just to /sw-, so that I can work around, in case things don't work out as smoothly, as they shall.

Whenever I see these thousands of dependencies … – OMG, my stomach! Once in a while these things break, and after like 20 years of sometimes breaking dependencies, you just don't really love it any more. That's why I prefer openSUSE over Ubuntu, ie. re-compiling installations.

The story ends like this for the time being: Any version of ImageMagick, that the fink team supports – they don't support for Lion.

Wednesday, June 8, 2011

how to print a PDF document together with its filename in its upper left corner?

This is only a very special case of "how to add text given on the command line to a PDF file?"

If I don't find a nice and read utility to do this,
  • I will create an image file from the PDF file,
  • I will create another image file from that text string (ImageMagick, GraphicsMagic?!?),
  • and I will finally overlay them (ImageMagick, GraphicsMagic?!?).
PDF Hacks' Hack# 90 describes how to "Superimpose PDF Pages"; there is also a one-liner with pdftk for that:
$ pdftk mydoc.pdf output mydoc.marked.pdf background watermark.pdf

I need to print like 200 rather similar (1-page) files, which look rather, rather similar, and I don't want to guess the filename from the contents of the page, so I prefer to print the filename on the same page as the actual contents.

Update 2011-07-04:
I am using text2pdf (a rather, rather simple tool) for this task (regard this as one logical line):

$ echo "text to be printed into the upper left corner" | /usr/local/text2pdf/text2pdf -A4 -s10 -v12 | pdftk original_file output file_with_sth_in_its_upper_left_corner background -

Tuesday, May 3, 2011

n-up several images

I need to compare like 100 pairs of images. I started by looking at them immediately one after the other. I don't feel comfortable with that. I want to see both of them together. I will create auxiliary images using ImageMagick and making use of this recipe:
convert -append input1.jpg input2.jpg input3.jpg -border 5 output.jpg
If I try doing this using GraphicsMagic, I don't see the border.

Now I am going to create the auxiliary images in a shell script…

Q: another task might be this: how do I also reduce the size of every single image, so that they all fit on one "page"?
That's not really relevant, as the usual image viewers are able to display image in just the right size on your screen.

Thursday, March 10, 2011

square photos in Google Contacts – create them with the help of ImageMagick's convert -splice

I really start appreciating ImageMagick and the transformations it supports, that I come across.

Google Contacts really prefers square photos, and if your photo does not have a square geometry, you have to crop it to a sub-square. Now that I know, how to insert a rectangle to the photo (with the help of ImageMagick's "convert -splice", GraphicsMagic doesn't support "convert -splice"), I will happily upload square photos from now on.

I was long wondering, how I could achieve this.

Linux.com :: ImageMagick or GraphicsMagick?

Linux.com :: ImageMagick (IM) or GraphicsMagick (GM)?

… unless you absolutely without-a-doubt need some new IM option not yet available in GM, the safe bet is to stick to GM's feature set, and write your app to work with either one. …

GraphicsMagick Image Processing System

GraphicsMagick Image Processing System

Wednesday, March 9, 2011

ImageMagick v6 Examples

ImageMagick v6 Examples

apress.com: The Definitive Guide to ImageMagick : 9781590595909

APRESS.COM : The Definitive Guide to ImageMagick : 9781590595909

This book will most certainly also help you with GraphicsMagick.

book: ImageMagick Tricks

ImageMagick Tricks Book & eBook | Packt Publishing Technical & IT Book Store

This book will most certainly also help you with GraphicsMagick.

how to copy a rectangle region from an image file? ("cropping")

My original source files are PDF files, but I already converted them to PNG using Ghostscript.

I was thinking of ImageMagick …

I came across phatch, I read of it here. It's a GUI, that helps running ImageMagick with certain operations in a batch. It came with a lot of dependencies on other packages. I tried to fullfil some of of them, eventually I gave up. If I very sure, that phatch was the way to go, that dependency hell wouldn't be a dead end. Spending time on getting phatch to run was a dead end for me.

There is a book on ImageMagick at PackPub, there is also one at Apress. I bought both of them as PDFs. That was the key to the success. I found nice examples, and I was able to apply some easy recipe to my task.

$ convert orig.png -crop geometry new.png

Actually the recommendation says to use "+repage", in order to not confuse certain software:

$ convert orig.png -crop geometry +repage new.png

Without "+repage" the file stores the displacement of the segment wrt. the original image, which comes in quite handy, but … certain software gets confused, eg. when I loaded one such new image into GIMP, GIMP displayed the displacement and presented me rubbish.

There is a fork of ImageMagick called GraphicsMagick. Pretty fast, but you may come across features of ImageMagick, that GraphicsMagick doesn't know.

…