PNG interlace

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

PNG interlace

Jeffg
Any idea when PNG interlace will be supported.  All my images are interlaced (PNG Crusher i expect) and I keep getting this:

jogamp.opengl.util.pngj.PngjUnsupportedException: PNG interlaced not supported by this library

Any way to get around this?  I'm using this...

InputStream is;
is = ...
mytexture = AWTTextureIO.newTexture(is, true, "png");
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
Hi

Rather use TextureIO.newTexture(AWTTextureIO.newTextureData(GLProfile.getDefault(),bufferedImage,true)), load the image by yourself as a buffered image and it should work.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Jeffg
Cool,  I'll update my code. Perhaps that could be added as the return instead of the Exception error.  I used ImageIO.read(is) to convert the inputstream into the bufferedimage.
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Sven Gothel
Administrator
In reply to this post by Jeffg
On 12/11/2012 11:35 PM, Jeffg [via jogamp] wrote:
> Any idea when PNG interlace will be supported.  All my images are interlaced
> (PNG Crusher i expect) and I keep getting this:
>
> jogamp.opengl.util.pngj.PngjUnsupportedException: PNG interlaced not supported
> by this library
>

Yup, we may need to update PNGJ or our utilization of it,
however, it has low priority.

If you or others like to volunteer - you are welcome.

Otherwise use Julien's suggestion or don't use interlace.

~Sven




signature.asc (909 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
I have just asked a question about that here:
http://code.google.com/p/pngj/wiki/Discussion
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Jeffg
Awesome -  Looks like you guys just need to update the PNGJ library in JOGL. :)
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
Yes but please can you write a request for enhancement (as a bug report) so that we don't forget it?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Jeffg
Sure, where do I submit it... I don't understand git-scm and I don't see where to submit bugs.  Consider GitHub - super easy :)

UPDATE: Found it.. Bugzilla, creating account now.. Still should consider GitHub - keeps it all in one place and easy to follow.
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

hernan
Hi, I'm the PNGJ developer. I'm glad that other people (apart from me) are using the library. I see that you have copied the source code, changing the package names. I'm not sure that's a good idea (both copying the source code instead of just referencing the pngj.jar, and also changing the package names). Unless  you had to make modifications of my code, just referencing the jar would seem  more clean and neat to me, and make updates much simpler.  Anyway, it's you decision.  Suggestions about the library and issues reports are welcomed.
Regarding interlaced PNG, they are supported now (for reading), though less tested - and much less efficient if you are reading line by line.

Hernan
-- Hernán J. González
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Sven Gothel
Administrator
On 12/19/2012 08:23 PM, Hernan [via jogamp] wrote:

> Hi, I'm the PNGJ developer. I'm glad that other people (apart from me) are
> using the library. I see that you have copied the source code, changing the
> package names. I'm not sure that's a good idea (both copying the source code
> instead of just referencing the pngj.jar, and also changing the package
> names). Unless  you had to make modifications of my code, just referencing the
> jar would seem  more clean and neat to me, and make updates much simpler.
>  Anyway, it's you decision.  Suggestions about the library and issues reports
> are welcomed.
> Regarding interlaced PNG, they are supported now (for reading), though less
> tested - and much less efficient if you are reading line by line.
>
Hi Hernan, great that you are here.

Here is the git commit incl. the motivation for
moving it in our namespace (collision, footprint):

+++

commit 40830196070013432bc5f453eb31cfe4c64e0510
Author: Sven Gothel <[hidden email]>
Date:   Sat Apr 7 15:28:37 2012 +0200

    Merge PNGJ 0.85 into namespace

    PNGJ Version 0.85  (1 April 2012)

    Apache 2.0 License

    http://code.google.com/p/pngj/

    Merged code:
      - Changed namespace ar.com.hjg.pngj -> jogamp.opengl.util.pngj
        to avoid collision when using a different version of PNGJ.

      - Removed test and lossy packages and helper classes
        to reduce footprint.

    License information is added in main LICENSE.txt file.

+++

If the package name collision is of no concern for JOGL users,
we can keep it in it's original place ofc.
I just wanted it to be 'anonymous' somehow, since JOGL users may
like to use an updated version of PNGJ, or use the lossy stuff,
which would not be possible in this case.

Updating PNGJ is on the list .. yup, definitely.

As mentioned earlier - thank you for your awesome efficient implementation,
very much appreciated.

~Sven

> Hernan


signature.asc (909 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

asambol
In reply to this post by gouessej
Are there any alternatives for  TextureIO.newTexture(AWTTextureIO.newTextureData(GLProfile.getDefault(),bufferedImage,true)) for Android?

Android doesn't have AWTTextureIO and I don't see a way to convert my BufferedImage to TextureData.

If I load the texture directly, without BufferedImage, transparency doesn't work. Textures are in PNG format.
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
asambol, use a more recent build of JOGL and if it doesn't work, please fill a bug report, add a PNG file with a transparency channel into it. I'm a bit surprised as we have some JUnit tests covering this case.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

asambol
I'm using the latest Jogl build (01-Nov-2012).

The PNG image doesn't have an alpha channel, but has a transparent background (it worked fine in JOGL1). Here's one example:
bar_left.png
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Sven Gothel
Administrator
On 04/23/2013 10:27 AM, asambol [via jogamp] wrote:
> I'm using the latest Jogl build (01-Nov-2012).
>

thats not latest ..

pls check wiki:
[1] <http://jogamp.org/deployment/archive/master/?C=M;O=D>
[2]
<https://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL#Downloading_the_latest_aggregated_autobuild>

~Sven


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
In reply to this post by asambol
Hi

asambol wrote
I'm using the latest Jogl build (01-Nov-2012).
I completely agree with Sven, this is not the latest build, this one is outdated and several limitations have been removed from the AWT-free PNG decoder.

asambol wrote
The PNG image doesn't have an alpha channel, but has a transparent background (it worked fine in JOGL1). Here's one example:
bar_left.png
You compare things that are very different but I understand your confusion as TextureIO in JOGL 1 uses AWT like AWTTextureIO in JOGL 2 which still works. There is no regression. Please use the latest aggregated build.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
In reply to this post by asambol
asambol wrote
The PNG image doesn't have an alpha channel, but has a transparent background (it worked fine in JOGL1). Here's one example:
bar_left.png
This is wrong, I have just checked with The Gimp 2.8.4, your image has an alpha channel and the background is transparent.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

asambol
Ok, I replaced my jars with latest Jogl version and the problem still persists. Result: bar-left-rendered.png (don't mind the blue line, it's from another png).

When the texture is loaded as BufferedImage, it works fine. If I convert the texture to DDS format (with alpha channel) and load it via TextureIO, it also works fine.

gouessej wrote
This is wrong, I have just checked with The Gimp 2.8.4, your image has an alpha channel and the background is transparent.
The image is created in Photoshop and contains only 3 channels. No alpha channel. No idea why Gimp shows the alpha channel as existing.
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

Sven Gothel
Administrator
On 04/24/2013 11:26 AM, asambol [via jogamp] wrote:

> Ok, I replaced my jars with latest Jogl version and the problem still
> persists. Result: bar-left-rendered.png
> <http://forum.jogamp.org/file/n4029016/bar-left-rendered.png> (don't mind the
> blue line, it's from another png).
>
> When the texture is loaded as BufferedImage, it works fine. If I convert the
> texture to DDS format (with alpha channel) and load it via TextureIO, it also
> works fine.
>
>     gouessej wrote
>     This is wrong, I have just checked with The Gimp 2.8.4, your image has an
>     alpha channel and the background is transparent.
>
> The image is created in Photoshop and contains only 3 channels. No alpha
> channel. No idea why Gimp shows the alpha channel as existing.
>
Thank you 'asambol'.

Would be great if you could add a bugreport
and attach the source PNG file, as well the visible artifact
plus you description.

If time allows I will try to squeeze this in 2.0.2
http://jogamp.org/wiki/index.php/SW_Tracking_Report_Objectives_for_the_release_2.0.2_of_JOGL

~Sven



signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PNG interlace

gouessej
Administrator
In reply to this post by asambol
asambol wrote
gouessej wrote
This is wrong, I have just checked with The Gimp 2.8.4, your image has an alpha channel and the background is transparent.
The image is created in Photoshop and contains only 3 channels. No alpha channel. No idea why Gimp shows the alpha channel as existing.
This is not an indexed PNG, there is no palette. Then, you say that it contains only RGB values but how is the transparency stored without alpha channel? If PNGJ sees your image as an RGB image, it won't handle transparency.
Julien Gouesse | Personal blog | Website