Showing posts with label imaging. Show all posts
Showing posts with label imaging. Show all posts

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.

Friday, September 17, 2010

digital cameras, the Orientation tag, pictures not standing upright

Modern cameras (some mobile phone cameras included) sense, what is up and what is down, if you take a picture. And if the software on your computer likes interpreting the "EXIF Orientation" flag of the picture, you will never notice, something unusual is going on. Some software doesn't though, so sometimes you are tempted to turn your picture long enough, until it does stand upright. But that kind of software also doesn't properly keep the Orientation flag in sync, so next time you browse you pictures with modern software, the pictures look no longer standing upright with that software.

Now today I thought of a simple trick, but I wasn't sure beforehand, whether it would work – and it did work.

Let me explain the idea! Let's suppose you watch your picture in modern software! If you turn your picture once to the left, and once to the right, that looks like it should not have any effect, but afterwards the Orientation tag is set to "Horizontal (normal)", and internally the picture is also represented "upright".

Why is that?
Well, when the software 1st picks up the picture with a value different to "Horizontal (normal)", it turns the picture, so that it looks upright to you. But I assume, you wouldn't like it, if that operation would cause the picture file to change on your disk, right?!?
But if you turn the picture to the left, that is an operation, that you would allow to have an effect to the picture file, right?!? And if you turn the picture to the right, that annuls the visual effect in your eyes.
If your software is rather smart, it only keeps track of the orientation changed and updates the EXIF Orientation tag. That wouldn't help us.
If your software isn't overly smart but just smart enough for us, it will leave the picture and the picture file in a state, so that the picture's internal representation is upright and the EXIF Orientation tag is set to "Horizontal (normal)", and everything is fine. Now pretty much every software will show the picture properly regardless of the EXIF Orientation tag.
Neat trick, isn't it? Works for me on Mac OS X with the Previewer.
That software requires me to confirm, that I want the changed files saved to disk. Other software may have done that already without asking you.

Friday, February 1, 2008

Microsoft Office Picture Manager

On the Windows platform this is my favourite imaging utility. It helps me compressing the documents I scanned and on multiple other issues.