Page 1 of 1

Updating my website examples

Posted: 2012-04-12T12:55:34-07:00
by Bonzo
I am updating my website and trying to finish off the examples. I have a list of missing ones due to not working, not tried and bad examples.

Here are a couple I can not understand why they are not working; any ideas?

No visable change to the input images ( 76,21 is a green pixel on the input image ):

Code: Select all

$cmd = " $input -green-primary 76,21 ";
exec("convert $cmd green_primary.jpg");

$cmd = "$input -channel red -threshold 50%";
exec("convert $cmd threshold.jpg");
Result was nearly completly white no matter what value I used for linear-stretch

Code: Select all

$cmd = " $input -linear-stretch 0.5 ";
exec("convert $cmd linear_stretch.jpg");
Tile-offset is a convert option and tile is a composite one. Am I using it in the wrong context?

Code: Select all

// Resize the boots image first to fit image
exec("convert $input1 -thumbnail 50x50 temp.png");
// Tile the image
$cmd = " -geometry +30+30 -tile-offset +120-120 tile:temp.png $input ";  
exec("composite $cmd tile_offset.jpg");
Has no effect on the font

Code: Select all

$cmd = "-size 213x160 -background NavajoWhite -fill black". 
" -gravity center -pointsize 30 -family Andalus -font Andalus -stretch UltraExpanded caption:\"Stretch\" "; 
exec("convert $cmd stretch.jpg ");

Re: Updating my website examples

Posted: 2012-04-12T14:54:51-07:00
by fmw42
I know nothing about -green-primary and the docs don't help. I wonder if x,y means something other than pixels coordinates.

With regard to -linear-stretch 0.5, you probably need to specify two values as the default will be Quantumrange - the one value.
You are also only stretching by 0.5 graylevels. Perhaps use %

convert rose: -linear-stretch 1,1% show:
or
convert rose: -linear-stretch 10,10% show:

In your last example, it appears that you are compositing with only one image. Though I have not tested your example. I know little about tile-offset. You probably need to change composite to convert. see http://www.imagemagick.org/Usage/canvas/#tile-offset

Re: Updating my website examples

Posted: 2012-04-12T23:53:27-07:00
by Bonzo
I will check your comments out fmw42 - I posted in a hurry and the tile-offset code is the wrong one as I had been trying different options.

I had started with -tile temp.png and that did not work and found tile:temp.png on Anthony's usage section.

Re: Updating my website examples

Posted: 2012-04-13T00:33:12-07:00
by anthony
fmw42 wrote:I know nothing about -green-primary and the docs don't help. I wonder if x,y means something other than pixels coordinates.
I know they are normalized coordinates in a XYZ colorspace.

Never really touched them either. But the internal defaults (from "image.c") are

image->chromaticity.red_primary.x=0.6400;
image->chromaticity.red_primary.y=0.3300;
image->chromaticity.green_primary.x=0.3000;
image->chromaticity.green_primary.y=0.6000;
image->chromaticity.blue_primary.x=0.1500;
image->chromaticity.blue_primary.y=0.0600;
image->chromaticity.white_point.x=0.3127;
image->chromaticity.white_point.y=0.3290;

The settings for these (same name) are simply 'stored' as strings, then applied as floats (no scaling) directly to these values. If the second number is missing the first number is applied to both X and Y, though really not providing two numbers is non-sensical, no syntax check is made for this. I have added a note that perhaps it should!

I think they are actually used for RGB to XYZ mapping but I have not checked it to be certain.
Their is something for 'black point compensation too. but again I am not certain.

If someone does no for certain, now is a good time to say so.

Re: Updating my website examples

Posted: 2012-04-13T11:59:56-07:00
by Bonzo
Tile-offset is not what I was expecting as I thought it would be the distance between each tile, it is working now.

There are two or three operators that nobody seems to know how they work or what they even do.

-linear-stretch is working.

even upgrading to the latest version -stretch has no effect - does it need pango or whatever its called?

Re: Updating my website examples

Posted: 2012-04-14T04:28:57-07:00
by glennrp
green_primary.x, etc., are elements of the chromaticity matrix. For each color, x+y must be positive and less than 1.0. If you specify one you should specify all six plus the white_point x and y. "x" and "y" have nothing to do with pixel location. In fact each component has a "z" that is internally computed by the color management system from (color.x + color.y + color.z = 1.0). The default numbers that you found in image.c are from the sRGB specification.

Re: Updating my website examples

Posted: 2012-04-14T06:11:42-07:00
by anthony
Bonzo wrote:Tile-offset is not what I was expecting as I thought it would be the distance between each tile, it is working now.
It should be how must to 'roll' or offset the tiling pattern for the -tile and tile: operators.
There are two or three operators that nobody seems to know how they work or what they even do.
Which often are special purpose settings.
-attunate -lowlight-color -highlight-color are such settings :-)
Little used with special purposes.

Code: Select all

-linear-stretch  is working
even upgrading to the latest version -stretch has no effect - does it need pango or whatever its called?
It is a normalization type operator. -stretching the histogram from the lowest and highest values found in the image.