image rotation

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

image rotation

Post by dav1988 »

hi,
i use imagemagick 7.0.7.21 for windows
i should verify if an image was rotated of an angle from the original one. the two pics may have different quality because of manipulation. my question is: is it possible to veryfy if the manipulated one was rotated?

thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: image rotation

Post by fmw42 »

What kind of images are they - what is the subject matter? Can you post an example set of images? You can upload to some free hosting service such as dropbox.com and put the URLs here. See http://im.snibgo.com/whatrotscale.htm
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

Hi,
for example this: http://oi67.tinypic.com/rkdgyr.jpg
and a manipulated copy of this image. I just need to check id the manipulated one was rotated of a small angle.

thanks in advance
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: image rotation

Post by fmw42 »

What I am trying to find out is if the rotated one has background fill or if it was a crop of a rotated image and has no fill.

Are you just trying to find out if the two images are of the same original picture vs whether the two images are of different scenes?
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

I will explain better. I have for example two images, the previous one : http://oi67.tinypic.com/rkdgyr.jpg and a manipulated version of the previous one: http://oi64.tinypic.com/x3ekr8.jpg . If i use compare it shows red points because the second one has a minor quality compared to the original. But i just want to know if the second one, that has been manipulaed and has a minor quality, was rotated of a small angle from the original.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: image rotation

Post by fmw42 »

I am not sure I see your images. The main images in those links are identical (The club). Please tell us how to download your uploaded images or use some other hosting service.
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

yes it is correct. the images look identical. but the second one has a minor quality. i want to estabilish if the second one has a little rotation (that could not be visible to the naked eye)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: image rotation

Post by fmw42 »

If it is not visible to the naked eye, why bother.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: image rotation

Post by snibgo »

dav1988 wrote:i want to estabilish if the second one has a little rotation
Then rotate the second image, and see if the match (eg the RMSE difference) is improved.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: image rotation

Post by fmw42 »

If the rotation is not visually noticeable, then I do not know of an process that would identify if it was rotated. Furthermore, you probably would not see much difference from compare even if you did rotate it perfectly.
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

hi. i think i solved the problem using GIMP. I used layer mode difference applied to the two images and the result is total black. so i think there is no rotation.

i have just one more question. GIMP says that the two images are identical, that is the pixel values are identical. But imagemagick COMPARE says there are differences between the original and the manipulated one, as you can see here: http://oi68.tinypic.com/opxvkk.jpg . I think because the manipulated one has a minor quality.

My question is: if it is not a difference in the colors, what kind of difference is the one that imagemagick is showing ?

thanks and sorry for my english
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: image rotation

Post by snibgo »

One file has an embedded profile, and the other doesn't. So how are you comparing them?
dav1988 wrote:I used layer mode difference applied to the two images and the result is total black.
It may look black, but it isn't, even using just 8-bit Gimp, whether or not we convert them to the same profile.
snibgo's IM pages: im.snibgo.com
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

One file has an embedded profile, and the other doesn't. So how are you comparing them?
i am not sure i am understanding what you mean... anyway i used the syntax compare file1.jpg file2.jpg diff.jpg...
It may look black, but it isn't, even using just 8-bit Gimp, whether or not we convert them to the same profile.
so even if it seems all black using gimp, the second image could be rotated?
dav1988
Posts: 19
Joined: 2018-01-07T13:18:56-07:00
Authentication code: 1152

Re: image rotation

Post by dav1988 »

this is whats happens using difference in GIMP: http://oi63.tinypic.com/28b7lud.jpg
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: image rotation

Post by snibgo »

Yes, it looks black. But how do you know it is black? When I open your images in Gimp as layers, mode Difference, the result looks black. But I make a new layer from visible, then Colors > Auto > Stretch contrast, I see where the differences are.

You can do the same trick with ImageMagick:

Code: Select all

convert rkdgyr.jpg x3ekr8.jpg -compose Difference -composite -auto-level d.png
d.png isn't black. This means your images are different. But the differences are very small.

d.png doesn't show obvious signs of rotation, so I doubt that is the cause.
snibgo's IM pages: im.snibgo.com
Post Reply