Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: converting Jpeg to grayscale

by snadra (Scribe)
on Jul 22, 2003 at 13:33 UTC ( #276717=note: print w/replies, xml ) Need Help??


in reply to converting Jpeg to grayscale

If you are willing to use other modules instead of GD you could also use Imager. It is easier to install than Image::Magick, and it is capable to do many image manipulation stuff as well.
It also has gif support, if you need that. It will ask if gif support should be enabled during the installation.
For setting the hue and saturation of the image do this:
my $color = Imager::Color->new(hue=>120, value=>1, saturation=>0.5);

Replies are listed 'Best First'.
Re: Re: converting Jpeg to grayscale
by Anonymous Monk on Jul 22, 2003 at 14:30 UTC
    Maybe I'm just to dumb to understand the documentation, but this seems like it should work no?
    use Imager; my $pregray = Imager->new(); $pregray->copy($original); my $grey = $pregray->convert(preset=>'grey');
    Or am I passing in the original image wrong?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://276717]
help
Chatterbox?
[stevieb]: I am thankful that I fell into Perl years ago in the manner I did. I don't believe there is another language that people care about so much, that they're willing to give everything. Langs come and go, but in Perl, it seems, things remain consistent.
[stevieb]: The people back then (~2000) are the same people now, but with much more experience. I'm appreciative that I fell into the Perl rabbit hole.
[stevieb]: Coding circles around Python devs, showing how unit tests should be done, enabling easy access to everything, learning basic C to wrap for direct hardware access... I am thankful.
[stevieb]: I'm in an appreciative mood. Thank you fellow Monks, for all I know, and for the knowledge which I can pass on

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-02-25 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (364 votes). Check out past polls.