Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: How to keep Imager's image files small ?

by tonyc (Pilgrim)
on Jul 28, 2012 at 00:19 UTC ( #984120=note: print w/replies, xml ) Need Help??

in reply to How to keep Imager's image files small ?

This is fairly simple:

  1. call to_paletted() with the quantization options you want, in your case max_colors => 16
  2. call write()

For example

my $pal = $source->to_paletted ( max_colors => 16, translate => "errdiff", ) or die $source->errstr; $pal->write(file => "foo.png") or die $pal->errstr;

That said, unless your images start with a small number of colours (non-photographic, no blends, little anti-aliasing) the results are going to be fairly ugly. You should test with some representative source images.

Replies are listed 'Best First'.
Re^2: How to keep Imager's image files small ?
by Anonymous Monk on Jul 28, 2012 at 03:49 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984120]
[james28909]: ok i have a new question ;)
[james28909]: i am not sure how to ask google this either
[james28909]: i am getting the current time on my machine with scalar localtime;
[james28909]: i am scraping a website and retrieving a date stamp of an article.
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday
[james28909]: and i need to format those special instances into an absolute date instead of "yesterday"

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-04-29 02:32 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.