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

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

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

in reply to Re^3: How to keep Imager's image files small ?
in thread How to keep Imager's image files small ?

You'd be wrong.

Imager can write to bmp, png, tif, ico at 4 bits per pixel, though png was only added to that list in Imager 0.90 (April 2012).

GIF is a special case - if the stored palette is 4 bits (16 colors) then it will start compression with a 5 bit code size, there's none of the packing 2 indices per byte as for the other formats.

  • Comment on Re^4: How to keep Imager's image files small ?

Replies are listed 'Best First'.
Re^5: How to keep Imager's image files small ?
by BrowserUk (Pope) on Jul 28, 2012 at 00:33 UTC

    I stand corrected. Thankyou.

    Out of interest, what triggers the writing of a 4-bit per pel .png?

    Is it simply if the image is palettised and only uses 16 colors? I couldn't see any mechanism for forcing it.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Exactly that.

      Unlike GIF, PNG supports direct colour, so there's no need for the automatic to_paletted() that writing a GIF does.

      I've considered adding an optimization option, but it's low priority.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984117]
[perldigious]: Also coincidentally, I'm currently in the middle of a winter storm that has dropped 1 foot of snow and is expected to drop another. I might have to adapt this for customers/vendors who come visit and put it at the beggining of every presentation I give.
[Discipulus]: the photo was removed... Cyrano de Berjerac was not of the same idea..
[stevieb]: perldigious: video near our hq in Montreal. Here in Calgary, it's -28c... we've only got 3" of snow so far, but there are several feet in the mountains already
[perldigious]: Snowshoeing time stevieb? I need to buy a pair so I can walk my German Shepherd properly through the country.
[stevieb]: yeah, I snowshoe a fair amount in the mountains. I also use spikes similar to these very often as well
[perldigious]: Discipulus: alternate link

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2016-12-06 16:30 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.