Identifying Wider vs Normal images

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?".
Post Reply
osnsubra
Posts: 7
Joined: 2014-08-28T10:22:50-07:00
Authentication code: 6789

Identifying Wider vs Normal images

Post by osnsubra »

Hi,
We have 2 different types of images 'normal' and 'wide' (the examples are attached) for which we need to apply two different Imagemagick 'convert' command to resize them to various formats. We are looking for 'Identify' command to differentiate a 'normal' vs 'wide' image so that the appropriate 'convert' command can be applied on the image.
I have looked at the documentation for 'identify' (like print-size, minimum & maximum pixels etc) but its giving the same output for both wide & normal images. Can you pls help finding the 'identify' command and by interpreting the output, we should be able differentiate a normal vs wide image.

https://www.dropbox.com/s/ziis8cl4oy4ys ... 1.png?dl=0
https://www.dropbox.com/s/7b51xldklgz9a ... 2.png?dl=0

https://www.dropbox.com/s/8xne5g5ew3sr3 ... 1.png?dl=0
https://www.dropbox.com/s/3t4ufnphoya0x ... 2.png?dl=0
https://www.dropbox.com/s/dux3jljlbthok ... 3.png?dl=0

Thanks in advance
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identifying Wider vs Normal images

Post by snibgo »

From those images, I can't say what is "normal" or "wide".

What do you mean? What is the rule that determines "normal" or "wide"?
snibgo's IM pages: im.snibgo.com
osnsubra
Posts: 7
Joined: 2014-08-28T10:22:50-07:00
Authentication code: 6789

Re: Identifying Wider vs Normal images

Post by osnsubra »

I have named the files names that are visible in the urls as 'normal' & 'wide'...

Basically we have wine bottles which are falling in 'Normal' category, and images for spirits, Beer cases would fall under 'Wide' category.
Let me know if any questions. Thanks in advance.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identifying Wider vs Normal images

Post by snibgo »

Yes, I can see they are named "normal" or "wide". Is that the rule? If a file starts with "wide" than process it one way, otherwise process it another way?

If that is the question, then you can use your shell to choose, based on the filename.
snibgo's IM pages: im.snibgo.com
osnsubra
Posts: 7
Joined: 2014-08-28T10:22:50-07:00
Authentication code: 6789

Re: Identifying Wider vs Normal images

Post by osnsubra »

We have around 60k product images with the productid as the filename. The automation we are doing is to convert each image to different dimensions.
We ended up into an issue that the same Imagemagick command is not working for both types of images (which i stated as 'normal' & 'wide'). So we want to use 'identify' command to find the type of image and apply the right image magick command. All our images are falling into these 2 types that i attached earlier.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identifying Wider vs Normal images

Post by snibgo »

I'll try once more, than I'll give up.

How do you decide which images are "wide" or "normal"?

I think you must have some rule. If you say what that rule is, I can probably translate it into an "identify" command.
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: Identifying Wider vs Normal images

Post by fmw42 »

Is normal the same as portrait, with height > width> And then is wide the same as landscape with width > height?

When you say the same command does not work for each, what is the exact command and what is your goal for resizing? Is the issue one of cropping vs padding?

Some examples would be helpful. You can post images to some free hosting service such as dropbox.com and put the URLs here.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Identifying Wider vs Normal images

Post by Bonzo »

I would say a "normal" image if trimmed would be a portrait style image whereas a "wide" when trimmed would be a squarer image. But as mentioned at what ratio does a normal become a wide?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Identifying Wider vs Normal images

Post by fmw42 »

Some of your wide examples are portrait mode. So it still remains to understand in what way you need to resize them and why it does not work right for you. Is the issue some minimum height/width aspect ratio that turns the image form normal to wide?

Can you post examples of the input and output results and what is wrong with the ones that do not work along with your command line?
Post Reply