<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hum, yeah RunLengthDecode doesn't seem to be the best algorithm for
this kind of image. Well, it's not really a good compression
algorithm at all from what I see!<br>
<br>
An interesting fact I found was that if I pass my 27 mb file to
ps2ps (ghostscript ps2write device), I end up with a 1.7 MB file
that is "/ASCII85Decode filter /LZWDecode filter". I don't know
much about these decoding algorithms, but it would be really nice if
that kind of post-compression happened directly in poppler's
pdftops.<br>
<br>
I'd be willing to help if someone helped me figure it out. I see
poppler already has a LZWStream class, would it simply be a matter
of pluging it in somewhere in PSOutputDev.cc, in place or in
addition to RunLengthDecode?<br>
<br>
Pierre-Luc<br>
<br>
<div class="moz-cite-prefix">On 01/27/2016 01:55 PM, William Bader
wrote:<br>
</div>
<blockquote cite="mid:BLU179-W92A4611AC4C52EFC120AEC4D90@phx.gbl"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
<div dir="ltr">tux-yellow and tux-white both convert to
a 2549x3299 RGB bitmap that is RunLength compressed and ASCII85
encoded.
<div><br>
</div>
<div>The yellow file is larger than the white file because "255
194 14" does not compress as well as "255 255 255".</div>
<div><br>
</div>
<div>The original tux image was Flate encoded with /DecodeParms
of <</Predictor 15/Columns 512>></div>
<div><br>
</div>
<div><span style="font-size: 12pt;">I am not a poppler
maintainer, but I think that it should be possible to add an
option to do Flate compression.</span></div>
<div>
<div><br>
</div>
<div>If you want to look at the code, open
poppler/PSOutputDev.cc and search for occurrences of
/RunLengthDecode</div>
</div>
<div><br>
</div>
<div>The "nothing" files are small because they paint the
background by drawing a box instead of by copying a bitmapped
image.</div>
<div><br>
</div>
<div>I think that when a PDF has several images on top of each
other, pdftops needs to convert the entire area to a bitmap
even if some of the parts were originally drawn with vector
commands. The original images have a bitmapped tux over a
vector background, but pdftops can't separate them and has to
rasterize the entire page.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>William</div>
<div><br>
<div><br>
<div>To: <a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
From: <a class="moz-txt-link-abbreviated" href="mailto:Pierre-Luc.Samuel@ticketmaster.com">Pierre-Luc.Samuel@ticketmaster.com</a><br>
Date: Tue, 26 Jan 2016 14:19:17 -0500<br>
Subject: [poppler] pdftops creates huge file with simple
color background (attached examples)<br>
<br>
<pre>Hi poppler team,
I have an issue with pdftops version 0.39.0 with conversion of some
specific templates to postscript. I have created very simple use cases
so that you can understand the issue.
pdftops tux-white.pdf
pdftops tux-yellow.pdf
ls -al *.ps
-rw-r--r-- 1 2816703 Jan 26 11:53 tux-white.ps
-rw-r--r-- 1 27576263 Jan 26 11:53 tux-yellow.ps
The size of the second PS is 27MB, but only the background color has
changed. This seems related to the fact that there is an image on the
template, because if I remove the image, there is no significant size
difference:
pdftops nothing-white.pdf
pdftops nothing-yellow.pdf
ls -al *.ps
-rw-r--r-- 1 11129 Jan 26 10:34 nothing-white.ps
-rw-r--r-- 1 11167 Jan 26 10:34 nothing-yellow.ps
Is this a known issue?
Thanks!
Pierre-Luc
</pre>
<br>
_______________________________________________
poppler mailing list
<a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/poppler">http://lists.freedesktop.org/mailman/listinfo/poppler</a></div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>