How to use SparseColor from PerlMagick?

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
joew
Posts: 42
Joined: 2012-08-23T01:19:56-07:00
Authentication code: 67789

How to use SparseColor from PerlMagick?

Post by joew »

Hello,

I am somewhat confused about how to use the SparseColor method.

I would like to do the aequivalent of

Code: Select all

convert [...] -sparse-color barycentric "0,0 yellow -%w,%h yellow  %w,%h limegreen" [...]
I have tried:

Code: Select all

$image->SparseColor(method=>"Barycentric", points=>"0,0 yellow -%w,%h yellow  %w,%h limegreen");
and

Code: Select all

$image->SparseColor(method=>"Barycentric", "0,0 yellow -%w,%h yellow  %w,%h limegreen");
and

Code: Select all

$image->SparseColor(method=>["Barycentric", "0,0 yellow -%w,%h yellow  %w,%h limegreen"]);
Any hints how to properly use this method?
Post Reply