It's OK, I've worked it out. There is another set of routines to retrieve normalised colour values (0..1) and they match up with dividing the Word values by 65535 so I'm guessing it's to support graphic formats that have ability to store a 2bytes per pixel colour depth. Anyway, I'm using the normalised values now and it's all good.

The ImageMagick libraries seem very good at handling large graphic files without being processor intensive (although you need a lot of hard drive space). I'm adapting a TGraphic descendant that someone wrote a few years ago for an earlier version, to work with the latest version of ImageMagick (seems they reworked their architecture somewhat). If anyone else is interested then let me know and I'll make the code available when it's polished off.

Phil.

Paul A Norman wrote:
Shouldn't, but is there a setting for the Colour Gamut?

On 21/04/06, Todd Martin <[EMAIL PROTECTED]> wrote:
Do you ever get values > 255?

Todd.

On Wednesday 19 Apr 2006 21:42, Phil Middlemiss wrote:
>  Thanks for the example Todd - yeah, that's compiling and seems to be
> running fine. There are no reported memory leaks around the pixel wands
> either.
>
>  One question though: the PixelPacket contains *Word* values for red,
> green, blue, and opacity. How do I interpret values greater than 255?
>
>  Cheers,
>  Phil.
>
>  Todd Martin wrote:
> Hi Phil
>
> I've only just started looking at Image Magic myself.
> Try this :)
> You'll need to add a correction and a function declaration to
> "pixel_iterator.inc" as outlined below.
>
> uses
>   magick_wand, ImageMagick;
>
> procedure DrawDiagonalLine(AInputFileName, AOutputFileName : AnsiString);
> var
>   Iterator : PPixelIterator;
>   PixelWands : PPPixelWand;
>   ImageWand : PMagickWand;
>   Status : MagickBooleanType;
>   RowIndex, WandCount : Cardinal;
> begin
>   Iterator := nil;
>   ImageWand := nil;
>   try
>     ImageWand := NewMagickWand;
>     status := MagickReadImage(ImageWand,PChar(AInputFileName));
>     if (status = MagickTrue) then
>     begin
>       //use a pixel iterator to draw a diagonal line
>       Iterator:=NewPixelIterator(ImageWand);
>       if assigned(Iterator) then
>       begin
>         //return the next row as an array of pixel wands
>         PixelWands:=PixelGetNextIteratorRow(Iterator,WandCount);
>         RowIndex := 0;
>         while assigned(PixelWands) do
>         begin
>           inc(PixelWands,RowIndex); //move to the pixel wand at column=row
>           PixelSetColor(PixelWands^,'#224466');
>           PixelSyncIterator(Iterator);
>           PixelWands:=PixelGetNextIteratorRow(Iterator,WandCount);
>           inc(RowIndex);
>         end;
>       end;
>
>       MagickWriteImage(ImageWand,PChar(AOutputFileName));
>     end;
>   finally
>     DestroyPixelIterator(Iterator);
>     DestroyMagickWand(ImageWand);
>   end;
> end;
>
> initialization
>   MagickWandGenesis;
>
> finalization
>   MagickWandTerminus;
>
>
> ....and put the following in pixel_iterator.inc
>
> //****correction*****
> function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl;
> external WandExport;
>
> //****extra declaration****
> function PixelGetNextIteratorRow(iterator: PPixeliterator; var columnCount
> : Cardinal) : PPPixelWand; cdecl; external WandExport;
>
> I compiled this in Kylix. Let me know if you have any problems.
> Todd.
>
> On Wednesday 19 Apr 2006 03:54, Phil Middlemiss wrote:
>
>
>  Yeah, I've got the source and looked through the API.
>
>  >From what I can see of the API though, it jumps straight down into the
>  > fine details of documenting each method and doesn't have anything that
>  > tells you "This is the general approach to use".
>
>  For example, I see that there is a routine called MagickSetFirstIterator
> (among other iteration routines) but nowhere does it describe the way to
> set up an iteration, or even what you are iterating. There is a pixel wand
> too (and a pixel iterator), but I can't find anything that describes the
> overall method of using them.
>
>  Have you got any examples (I don't care if they are not documented) that I
> could look at?
>
>  Cheers,
>  Phil.
>
>  Todd Martin wrote:
> Hi Phil
>
> Have you looked at the API documents?
> {myInstallDirectoryForImageMagic}/share/doc/ImageMagick-6.2.6/www/api
>
> Are you running Windows or Linux? Do you have the ImageMagic source or just
> a binary download?
>
> Todd.
>
> On Wednesday 19 Apr 2006 02:39, Phil Middlemiss wrote:
>
>
> Hi all,
>
> I'm trying to understand Image Magick - I have got the Lazerus headers
> and compiled and run the sample app listed on the wiki page for it. All
> fine.
>
> Now when it comes to actually working out how to use the thing I'm not
> sure how to go about it. The documentation is a little different from
> the actual Lazerus files, and even if it were the same it is lacking the
> whole "This is the overview/paradigm" section.
>
> What I really need is a good example that does more than just read in an
> image and save it to another format. Does anyone has some
> examples/documentation that they are willing to share?
>
> Cheers,
> Phil.
>
>
> _______________________________________________
> Delphi mailing list
> [email protected]
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
>
> _______________________________________________
> Delphi mailing list
> [email protected]
> http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi


begin:vcard
fn:Phil Middlemiss
n:Middlemiss;Phil
org:Vision Software, MTS Ltd
email;internet:[EMAIL PROTECTED]
title:Project Leader
tel;work:+64 7 3480001
tel;cell:+64 27 4592648
x-mozilla-html:TRUE
url:http://www.tumonz.co.nz
version:2.1
end:vcard

_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to