Re: Removing all "not essential" data from an image file.

Eric Arrigo <[email protected]>
Newsgroups gmane.comp.video.image-magick.user
Message-ID <[email protected]>
Thanks for your quick reply Martin :o)

2010/4/27 Martin Weis <[email protected]>

> Hallo Eric!
>
> Eric Arrigo schrieb:
> > I was using pngcrush for years in order to reduce my websites images,
> > thinking that this would actually remove any unused bit of data.
> > Yesterday, I used the data uri kitchen on one of those pngcrushed images,
> > and I was puzzled to discover that the header still hold some text
> > information about the application that created the image.
> >
> > Is there a way to strip the image meta data with image-magick?
>
> converting to plain ppm and back usually does this kind of trick, if you
> you do not find an option for it.
>
> > Here is the data uri of the image:
> >
> data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0C%00%00%00%0C%08%06%00%00%00Vu%5C%E7%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01eIDAT(SURM%2BDa%14~%7F%0A%0B%0B%D24%92F%92%92D%92%B2%10%7F%40IR%16vR%B2%91dG%8C13%BE%BF%F2%B1%92%91%94%8F%C2J%B1%B1%B0%96%14w1S%F7%BC%EFe%8Es%9E%3B%D7%C7%5Bo%EF%E9%DC%E79%E79%CF%B9%C6%9F%2B%8BS*%E6%D1j%03%D3z%13%D3F3%D3f%0B%D3v%1B%DB%9Dv%B9%1Dxi%A5%DES%AC%018%15cw%DC%1F%02%FF%12%B7Z%7FI%BB%9DL%D9%84g(%5D%CBz%A3S%CC%BF%F0%E7C%86%ED~%F7%7Fp%A9%A3A%B5l%82%5Dn%08%C0%E2%C7sH%2C%BC%22%17%81%A3%8E%06%81%C8P%B0%3B%1BA2%B8%9A%60v%05%5C%97%1B%0C%C1k%8Dx%0DtK%97%1FIR9%B8%9Edw%3A%0C%82J%C4%D0%A2Bq%26j%A7%9A%83%BBY%10%F4h%17w9%1E%C6%92%A7t%8D%3A%C5%06l%91%E1%CEG%F1%C1%1E%F6%82%A4%95U%86%BE%C5%F7'%A6%A5j%A6L%9D%12B%9F%A1Y%AB%DD%CEpp3%85%D8%9D%0Cpp%9FD%EC%2FV%C2Mc%F7%BA%60%DD%D7%DB%23%B3%CD%B3%3D%EAc%7B%D0S%22O%B3%BB%18C%AC8%3FY%253%C8%06%FFY%A7n%E8%80%AAYdhe%7F%A1%82%FD%F9r%25x%06%BF%86l%10n%C9%2C%20%E9nd%40%D5%8C%C5.%C7%01V%EC7%84i
> %!
> >  BC%B3%D8%CC%F1W%00%00%00%00IEND%AEB%60%82
> >
> > You may see some information about Adobe ImageReady that take almost 10%
> of
> > the image size and that I would like to remove (i tried "-max 0" in
> pngcrush
> > to limit the IDAT size, but it seems this information is not into the
> IDAT
> > chunk).
>
> minimum is 1:
>       -max maximum_IDAT_size
>                 Set the maximum idat size to be used when creating the
> compression buffer.[1 through 524288]
>
>
I tried "1" but it seems I was wrong when thinking that IDAT was the "Extra
data"... It is the size of some "used for compression" data, and if I use
the value "1", the file size augment by more than 800% :o)


> ...and there are some more text related options, did you try these?
>

After upgrading my old pngcrush to version 1.7.9, I found a new option -rem.
This is not very clear which chunk I am supposed to remove, but "-rem text"
seems to do what I wanted.

I appologize for this off topic subject, but if someone knows a way to
obtain the same result with image-magick, I am still very interested.

(Funily, converting the png to PPM and bac to PNG and cruching it with "-rem
text" gives a slightly bigger file that crushing the original png with "-rem
text" (18 extra bytes)).

Eric



>
> > While I am in questions, would it be any way to have Image-Magick do
> > pngcrush's job (especially the -reduce -brute options) so I don't need to
> > use two sets of tools?
>
> sorry, I do not know.
>
> Martin
>
>


-- 
"Protégez les arbres, mangez du castor"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.