Page 3 of 3

Re: How to get color information

Posted: 2012-04-11T22:48:53-07:00
by VanGog
Anthony:
Can you explain me why this command:

Code: Select all

convert -size 250x250 xc:white -draw "point 20,15 point 150,25 point 200,140 point 15,125" -bordercolor black -border 7 -trim  -format "%P%O" -write info: output.gif
    264x264+7+7

Why the image (canvas) is 264x264 and not 250x250? This is confusing.

I would expect number like 250x250+25+15
250x250 is dimension of canvas. 25 because the first vertical line of cut is 25 pixels from the left edge of the canvas. 15 because the first horizontal line of cut is 15 pixels from the top edge of the canvas. So why this incorrect number: 264x264+7+7

This is example how it should look in PS:
Image

I know about that link, I watched it to create the dots. I need only single dots for this.

Re: How to get color information

Posted: 2012-04-12T00:15:29-07:00
by anthony
VanGog wrote:Why the image (canvas) is 264x264 and not 250x250? This is confusing.

I would expect number like 250x250+25+15
250x250 is dimension of canvas. 25 because the first vertical line of cut is 25 pixels from the left edge of the canvas. 15 because the first horizontal line of cut is 15 pixels from the top edge of the canvas. So why this incorrect number: 264x264+7+7
You started with a 250x250 canvas, then added a 7 pixel border to all sizes making the canvas (and virtual canvas) 264x264 The trim only trimmed the actual added border, reducing it to a 250x250 real image on a 264x264 virtual canvas, with a +7+7 offset.

virtual information
%W page (canvas) width
%H page (canvas) height
%X page (canvas) x offset (including sign)
%Y page (canvas) y offset (including sign)
%O page (canvas) offset ( = %X%Y )
%P page (canvas) size ( = %Wx%H )
%g layer canvas page geometry ( = %Wx%H%X%Y )

real image info (at the offset on the virtual canvas)
%w current width in pixels
%h current image height in pixels
%G image size ( = %wx%h )

I myself like to list information as...
%G%O on %P
The first is the 'crop' that was used on a virtual canvas.

If you remove the -format to get the default 'format' output, you will see real image, then virtual image information listed. -format is typically used to just get exactly the information wanted and no more.

Re: How to get color information

Posted: 2012-04-12T01:23:21-07:00
by VanGog
Oh. I wanted to trim the pixels, than add border, and then trim again.

Re: How to get color information

Posted: 2012-05-22T12:16:25-07:00
by VanGog
I need help with this. I have txt output:

9,82: (255,255,255) #FFFFFF white

How to get just

9,82:white

?

Re: How to get color information

Posted: 2012-05-22T16:09:29-07:00
by fmw42
I don't know how you would do this in windows, but in unix, one way is:


str="9,82: (255,255,255) #FFFFFF white"
echo "$str" | sed -n 's/^\(.*,.*\):.*[#].* \(.*\)$/\1:\2/p'
9,82:white

See if windows has sed function

Re: How to get color information

Posted: 2012-05-22T23:38:00-07:00
by VanGog
I thought you use fx
http://www.imagemagick.org/script/fx.php
to filter the output of txt:-

Re: How to get color information

Posted: 2012-05-23T09:59:17-07:00
by fmw42
VanGog wrote:I thought you use fx
http://www.imagemagick.org/script/fx.php
to filter the output of txt:-
Not that I know about. But Anthony may have some ideas. It might be nice for IM 7 to be able to things like that.

Re: How to get color information

Posted: 2012-05-23T11:39:41-07:00
by VanGog
VanGog wrote:I thought you use fx
http://www.imagemagick.org/script/fx.php
to filter the output of txt:-
Note: This doesn't solve problem of performance, mentioned here:
viewtopic.php?f=1&t=21061&p=85345#p85345