Page 1 of 1

Sub images and their position

Posted: 2016-02-22T02:45:31-07:00
by rananaskar
Hello guys i am generating mug with Freds imagemagick cylinder script.

Left view in transparent image
Image

Middle view in transparent image
Image

I want to find the NEW and ANOTHER both elements position in the left image.

I also want to find the positions of images in middle view.

Any help would be appreciated.

Re: Sub images and their position

Posted: 2016-02-22T10:51:31-07:00
by fmw42
Sorry, I do not know what you are asking. Can you explain a bit further? What does your question have to do with the cylinderize script?

Re: Sub images and their position

Posted: 2016-02-23T02:37:49-07:00
by rananaskar
If i have an big transparent image with few texts and images at different position.

How can i find position and size of those texts and images in the main image.

Any help would be appreciated.

Re: Sub images and their position

Posted: 2016-02-23T10:09:17-07:00
by snibgo
With "-trim" or "-format %@".

Code: Select all

convert in.png -format %@ info:

Re: Sub images and their position

Posted: 2016-02-23T19:57:17-07:00
by rananaskar
snibgo wrote:With "-trim" or "-format %@".

Code: Select all

convert in.png -format %@ info:
With trim i can not get the position of the individual elements like this. I am getting whole elemnts position after trimming
Image


But i want to get it like this
Image

I want to get the position and size of individual elements in the main image

Any help would be appreciated

Re: Sub images and their position

Posted: 2016-02-23T20:11:04-07:00
by snibgo
Then you first need to crop to the individual elements. What defines the separation? Perhaps one element is always in the top half, and the other is in the bottom half. Or perhaps they are always separated by horizontal white.

Re: Sub images and their position

Posted: 2016-02-23T20:23:46-07:00
by fmw42
If you can assume that there are rows of text separate by white space between, then you can average the image down to one column, then search to find white between areas of gray. Then crop horizontally on the white spaces and trim to remove excess white.