Shouldn't this code either produce a red box or a red box with black border on three sides and green border on one side?
Tools.PV( Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(70,0,80,80,0,255,0)->autocrop() );
No?
Since the right "border" is of a different colour then the left "border", it's considered not a border.
/ Mirar
Previous text:
2003-07-23 16:15: Subject: autocrop
Shouldn't this code either produce a red box or a red box with black border on three sides and green border on one side?
Tools.PV( Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(70,0,80,80,0,255,0)->autocrop() );
/ Martin Nilsson (ja till euro, nej till cent)
But the left "border" is a different color than the right "border", so why is it considered a border? Compare the last example with
Tools.PV( Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(0,0,10,80,0,255,0)->autocrop() );
/ Martin Nilsson (ja till euro, nej till cent)
Previous text:
2003-07-23 19:37: Subject: autocrop
No?
Since the right "border" is of a different colour then the left "border", it's considered not a border.
/ Mirar
i suppose it will just take the first color that it can find which is croppable, starting at the upper left.
compare: Tools.PV(Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(70,0,80,80,0,255,0)->autocrop()->autocrop()); and Tools.PV(Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(70,0,80,80,0,255,0)->autocrop()->autocrop()->autocrop());
I think it starts in some order, say left, right, top, bottom. When it finds a line at the edge of the same colour, it locks on to that colour.
It could very well have given you a red image with a black border except on the right side, if it's not defined in the docs.
/ Mirar
Previous text:
2003-07-23 20:03: Subject: autocrop
But the left "border" is a different color than the right "border", so why is it considered a border? Compare the last example with
Tools.PV( Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(0,0,10,80,0,255,0)->autocrop() );
/ Martin Nilsson (ja till euro, nej till cent)
The docs says
"Unneccesary" is all pixels that are equal -- ie if all the same pixels to the left are the same color, that column of pixels are removed.
which I take as both left and right side (and possible the top and bottom) or no side at all should be cropped.
/ Martin Nilsson (ja till euro, nej till cent)
Previous text:
2003-07-23 21:16: Subject: autocrop
I think it starts in some order, say left, right, top, bottom. When it finds a line at the edge of the same colour, it locks on to that colour.
It could very well have given you a red image with a black border except on the right side, if it's not defined in the docs.
/ Mirar
i see no 'right' mentioned in that description,
gimp autocrop behaves just like pike, xv cuts the left and the right side
like the result of: Image.Image(80,80,0,0,0)->box(10,10,70,70,255,0,0)->box(70,0,80,80,0,255,0)->autocrop()->autocrop()
gimp has an additional function: zealous crop, that behaves like xv.
haven't found other editors yet.
greetings, martin.
pike-devel@lists.lysator.liu.se