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 Adam Kovacs <a....@i-docs.com> on 2010/08/13 13:41:19 UTC

PNG vs JPG in performance

Hi there!

 Im currently having a strange effect. I use PNG images in my XSL to create PDFs.
I have real performance problems (the XSL is quite complex and looks fancy with many images)

If I use PNGs it takes 30s to create a PDF.
If I use JPGs it takes only 2,5s to create the same PDF (JPGs created from the PNGs)

Im creating the PDFs over the FOP_IF and with concatenation of more FOP_IF files.

Can anybody explain this to me? I would need to use PNGs as the printer likes them more.
Is there any other format which is even more faster? (Giff or anything else?)

Thanks in advance!!!

Adam 
Using FOP 1.0

Re: PNG vs JPG in performance

Posted by Ognjen Blagojevic <og...@gmail.com>.
Hi Matthias,

Do zou know to which format are they trasformed?

Regards,
Ognjen


On 13.8.2010 14:37, Matthias Reischenbacher wrote:
> Hi Adam,
>
> I think the cause of the 30sec delay is that PNGs aren't embedded
> natively into the PDF and they must be transcoded first.
> It would be really nice, if the FOP-Team could fix this issue, since
> this problem also occurs when using PNGs inside SVGs and converting PNGs
> to JPEGs isn't so easy in this case.
>
> Regards,
> Matthias
>
> On 13.08.2010 08:41, Adam Kovacs wrote:
>> Hi there!
>>
>> Im currently having a strange effect. I use PNG images in my XSL to
>> create PDFs.
>> I have real performance problems (the XSL is quite complex and looks
>> fancy with many images)
>>
>> If I use PNGs it takes 30s to create a PDF.
>> If I use JPGs it takes only 2,5s to create the same PDF (JPGs created
>> from the PNGs)
>>
>> Im creating the PDFs over the FOP_IF and with concatenation of more
>> FOP_IF files.
>>
>> Can anybody explain this to me? I would need to use PNGs as the printer
>> likes them more.
>> Is there any other format which is even more faster? (Giff or anything
>> else?)
>>
>> Thanks in advance!!!
>>
>> *Adam *
>> *Using FOP 1.0*
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 5363 (20100813) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


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


Re: PNG vs JPG in performance

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hehe, just like this week. I don't have a patch but you can have the
files I've copied aside. You may need to write some plumbing for the
plugins (META-INF/services), and unfortunately, I didn't seem to have
saved the image handler plug-in for FOP, just the image adapter for the
PDF library. But with the other examples (see PDFImageHandlerRawCCITTFax)
you should have that quickly. I'm curious if you'll manage to get it to
work. Have fun.

On 13.08.2010 17:22:17 Matthias Reischenbacher wrote:
> Jeremias,
> 
> do you have a patch file of your work with PNG? Perhaps with a second 
> pair of eyes we could resolve that issue... ;-)
> 
<snip/>



Jeremias Maerki

Re: PNG vs JPG in performance

Posted by Matthias Reischenbacher <ma...@gmx.at>.
Jeremias,

do you have a patch file of your work with PNG? Perhaps with a second 
pair of eyes we could resolve that issue... ;-)

Regards,
Matthias

On 13.08.2010 12:06, Jeremias Maerki wrote:
> Matthias is right. The PNGs need to be decoded and re-encoded. Some time
> ago I've made experiments to embed PNG files without re-encoding them
> but I haven't gotten that to work. Somehow the data was not quite right
> so Acrobat barked at me with its usual unhelpful error messages. :-( At
> the moment the only data formats we can embed without re-encoding are
> JPEG and CCITT Group 3 and 4.
>
> BTW, inside PDF there's no such thing as PNG or GIF. PDF uses its own
> representation of bitmap images. So that means we always have to
> interpret an image file and convert it to PDFs internal objects.
>
> On 13.08.2010 14:37:44 Matthias Reischenbacher wrote:
>> Hi Adam,
>>
>> I think the cause of the 30sec delay is that PNGs aren't embedded
>> natively into the PDF and they must be transcoded first.
>> It would be really nice, if the FOP-Team could fix this issue, since
>> this problem also occurs when using PNGs inside SVGs and converting PNGs
>> to JPEGs isn't so easy in this case.
>>
>> Regards,
>> Matthias
>>
>> On 13.08.2010 08:41, Adam Kovacs wrote:
>>> Hi there!
>>>
>>> Im currently having a strange effect. I use PNG images in my XSL to
>>> create PDFs.
>>> I have real performance problems (the XSL is quite complex and looks
>>> fancy with many images)
>>>
>>> If I use PNGs it takes 30s to create a PDF.
>>> If I use JPGs it takes only 2,5s to create the same PDF (JPGs created
>>> from the PNGs)
>>>
>>> Im creating the PDFs over the FOP_IF and with concatenation of more
>>> FOP_IF files.
>>>
>>> Can anybody explain this to me? I would need to use PNGs as the printer
>>> likes them more.
>>> Is there any other format which is even more faster? (Giff or anything
>>> else?)
>>>
>>> Thanks in advance!!!
>>>
>>> *Adam *
>>> *Using FOP 1.0*
>>>
>>>
>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>> signature database 5363 (20100813) __________
>>>
>>> The message was checked by ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 5364 (20100813) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>

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


Re: PNG vs JPG in performance

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Matthias is right. The PNGs need to be decoded and re-encoded. Some time
ago I've made experiments to embed PNG files without re-encoding them
but I haven't gotten that to work. Somehow the data was not quite right
so Acrobat barked at me with its usual unhelpful error messages. :-( At
the moment the only data formats we can embed without re-encoding are
JPEG and CCITT Group 3 and 4.

BTW, inside PDF there's no such thing as PNG or GIF. PDF uses its own
representation of bitmap images. So that means we always have to
interpret an image file and convert it to PDFs internal objects.

On 13.08.2010 14:37:44 Matthias Reischenbacher wrote:
> Hi Adam,
> 
> I think the cause of the 30sec delay is that PNGs aren't embedded 
> natively into the PDF and they must be transcoded first.
> It would be really nice, if the FOP-Team could fix this issue, since 
> this problem also occurs when using PNGs inside SVGs and converting PNGs 
> to JPEGs isn't so easy in this case.
> 
> Regards,
> Matthias
> 
> On 13.08.2010 08:41, Adam Kovacs wrote:
> > Hi there!
> >
> > Im currently having a strange effect. I use PNG images in my XSL to
> > create PDFs.
> > I have real performance problems (the XSL is quite complex and looks
> > fancy with many images)
> >
> > If I use PNGs it takes 30s to create a PDF.
> > If I use JPGs it takes only 2,5s to create the same PDF (JPGs created
> > from the PNGs)
> >
> > Im creating the PDFs over the FOP_IF and with concatenation of more
> > FOP_IF files.
> >
> > Can anybody explain this to me? I would need to use PNGs as the printer
> > likes them more.
> > Is there any other format which is even more faster? (Giff or anything
> > else?)
> >
> > Thanks in advance!!!
> >
> > *Adam *
> > *Using FOP 1.0*
> >
> >
> > __________ Information from ESET NOD32 Antivirus, version of virus
> > signature database 5363 (20100813) __________
> >
> > The message was checked by ESET NOD32 Antivirus.
> >
> > http://www.eset.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


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


Re: PNG vs JPG in performance

Posted by Matthias Reischenbacher <ma...@gmx.at>.
Hi Adam,

I think the cause of the 30sec delay is that PNGs aren't embedded 
natively into the PDF and they must be transcoded first.
It would be really nice, if the FOP-Team could fix this issue, since 
this problem also occurs when using PNGs inside SVGs and converting PNGs 
to JPEGs isn't so easy in this case.

Regards,
Matthias

On 13.08.2010 08:41, Adam Kovacs wrote:
> Hi there!
>
> Im currently having a strange effect. I use PNG images in my XSL to
> create PDFs.
> I have real performance problems (the XSL is quite complex and looks
> fancy with many images)
>
> If I use PNGs it takes 30s to create a PDF.
> If I use JPGs it takes only 2,5s to create the same PDF (JPGs created
> from the PNGs)
>
> Im creating the PDFs over the FOP_IF and with concatenation of more
> FOP_IF files.
>
> Can anybody explain this to me? I would need to use PNGs as the printer
> likes them more.
> Is there any other format which is even more faster? (Giff or anything
> else?)
>
> Thanks in advance!!!
>
> *Adam *
> *Using FOP 1.0*
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 5363 (20100813) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com

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