You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Lauri Kasanen <ca...@gmx.com> on 2013/07/02 12:07:59 UTC

Poor quality image scaling

Hi,

Picture of the issue: http://i43.tinypic.com/2hq4ilf.png

I use 256x256 PNG admonition images. They are specced in the generated .fo 
file as having content-width of 36 pt, which is half an inch I understand.
At a target DPI of 300, this would be 150x150.

As you can see in the pic, it's obvious FOP uses a poor quality image 
scaling algorithm, nearest-neighbor, or point sampling in GL terms.

How can I tell FOP to use a better quality algorithm? Ideally at least 
bicubic, but bilinear would be a great improvement too.

Thanks,
- Lauri

PS: Please CC me, not subscribed.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Lauri Kasanen <ca...@gmx.com>.
Luis Bernardo <lmpmbernardo <at> gmail.com> writes:

> Can you attach the file? I am unable to download it.

Gmane does not let me do that. Trying another hoster:

https://anonfiles.com/file/ba2371af6890b4f038dbfe0665d49c96
http://stashbox.org/v/1170761/fopzip.zip

- Lauri


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Luis Bernardo <lm...@gmail.com>.
Can you attach the file? I am unable to download it.


On Tue, Jul 2, 2013 at 3:15 PM, Lauri Kasanen <ca...@gmx.com> wrote:

> Luis Bernardo <lmpmbernardo <at> gmail.com> writes:
>
> > Your screen capture is not half an inch, so we don't know where the
> scaling comes from. Have you tried to zoom in with your PDF viewer?
> > If you still have questions please provide original image, your fo file,
> any fop.xconf if using it, and the generated pdf. I was unable to reproduce
> the issue you describe with a stock png image.
>
> Here's a zip containing the requested files:
> http://bayfiles.net/file/S52n/Gw7iCz/fopzip.zip
>
> The image in the PDF looks bad at all zoom levels (100%, fit to window, fit
> to width, 300%, ...).
>
> Thanks,
> - Lauri
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

Re: Poor quality image scaling

Posted by Philipp Wagner <li...@philipp-wagner.com>.
Am 02.07.2013 17:54, schrieb Philipp Wagner:
> Am 02.07.2013 16:15, schrieb Lauri Kasanen:
>> Luis Bernardo <lmpmbernardo <at> gmail.com> writes:
>>
>>> Your screen capture is not half an inch, so we don't know where the
>> scaling comes from. Have you tried to zoom in with your PDF viewer?
>>> If you still have questions please provide original image, your fo file,
>> any fop.xconf if using it, and the generated pdf. I was unable to
>> reproduce
>> the issue you describe with a stock png image.
>>
>> Here's a zip containing the requested files:
>> http://bayfiles.net/file/S52n/Gw7iCz/fopzip.zip
>>
>> The image in the PDF looks bad at all zoom levels (100%, fit to
>> window, fit
>> to width, 300%, ...).
>
> It does look fine here in Acroread as well as in Okular; I would not
> expect FOP to actually do the scaling but the PDF viewer, but maybe the
> devs can answer that better than I do.

Actually, extracting the images using pdfimages (from poppler-utils) 
confirms that, the images are 256x256 px inside the PDF, just as the 
original ones. So all scaling comes from the PDF viewer.

Philipp

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Lauri Kasanen <ca...@gmx.com>.
Hi,

please consider this issue solved. Other PDF viewers don't show the issue, 
so apparently the flag is not that important.

- Lauri


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Lauri Kasanen <ca...@gmx.com>.
Philipp Wagner <lists <at> philipp-wagner.com> writes:
> 
> It does look fine here in Acroread as well as in Okular; I would not 
> expect FOP to actually do the scaling but the PDF viewer, but maybe the 
> devs can answer that better than I do.

Further googling lead me to see that there's a flag embedded in the PDF 
saying whether or not an image should be interpolated.

http://superuser.com/questions/358134/pdf-rendering-of-images-seems-to-vary-
from-viewer-to-viewer-with-blurring
https://bugs.freedesktop.org/show_bug.cgi?id=25268

It appears that FOP does not set this flag. Any comments?

- Lauri


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Philipp Wagner <li...@philipp-wagner.com>.
Am 02.07.2013 16:15, schrieb Lauri Kasanen:
> Luis Bernardo <lmpmbernardo <at> gmail.com> writes:
>
>> Your screen capture is not half an inch, so we don't know where the
> scaling comes from. Have you tried to zoom in with your PDF viewer?
>> If you still have questions please provide original image, your fo file,
> any fop.xconf if using it, and the generated pdf. I was unable to reproduce
> the issue you describe with a stock png image.
>
> Here's a zip containing the requested files:
> http://bayfiles.net/file/S52n/Gw7iCz/fopzip.zip
>
> The image in the PDF looks bad at all zoom levels (100%, fit to window, fit
> to width, 300%, ...).

It does look fine here in Acroread as well as in Okular; I would not 
expect FOP to actually do the scaling but the PDF viewer, but maybe the 
devs can answer that better than I do.

Philipp

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Lauri Kasanen <ca...@gmx.com>.
Luis Bernardo <lmpmbernardo <at> gmail.com> writes:

> Your screen capture is not half an inch, so we don't know where the 
scaling comes from. Have you tried to zoom in with your PDF viewer?
> If you still have questions please provide original image, your fo file, 
any fop.xconf if using it, and the generated pdf. I was unable to reproduce 
the issue you describe with a stock png image.

Here's a zip containing the requested files:
http://bayfiles.net/file/S52n/Gw7iCz/fopzip.zip

The image in the PDF looks bad at all zoom levels (100%, fit to window, fit 
to width, 300%, ...).

Thanks,
- Lauri


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Poor quality image scaling

Posted by Luis Bernardo <lm...@gmail.com>.
Your screen capture is not half an inch, so we don't know where the scaling
comes from. Have you tried to zoom in with your PDF viewer?

If you still have questions please provide original image, your fo file,
any fop.xconf if using it, and the generated pdf. I was unable to reproduce
the issue you describe with a stock png image.


On Tue, Jul 2, 2013 at 11:07 AM, Lauri Kasanen <ca...@gmx.com> wrote:

> Hi,
>
> Picture of the issue: http://i43.tinypic.com/2hq4ilf.png
>
> I use 256x256 PNG admonition images. They are specced in the generated .fo
> file as having content-width of 36 pt, which is half an inch I understand.
> At a target DPI of 300, this would be 150x150.
>
> As you can see in the pic, it's obvious FOP uses a poor quality image
> scaling algorithm, nearest-neighbor, or point sampling in GL terms.
>
> How can I tell FOP to use a better quality algorithm? Ideally at least
> bicubic, but bilinear would be a great improvement too.
>
> Thanks,
> - Lauri
>
> PS: Please CC me, not subscribed.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>