Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  PNG bug?  (Read 2380 times)
0 Members and 1 Guest are viewing this topic.
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Posted 2003-11-06 21:29:51 »



These two images should look identical. They look identical in my browser (Firebird), in my image viewer (irfan view) and in other programms too.

See for yourself:
PNGBug.jar (4kb - ugly useless source included)

The image labled with "/gfx/set_o.png" was produced by PNGCrush.

However, I don't know if that image is kinda malformed or don't fullfill the specs... but I thought here might be someone around who can check that.

edit: ooooh... forgot my system specs  Lips Sealed

Running win98se, 1.4.2 (build 1.4.2-b28, mixed mode)

弾幕 ☆ @mahonnaiseblog
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #1 - Posted 2003-11-06 22:07:07 »

I get the same thing on a Mac.  I think you can get a 'pngcheck' program that will validate the file to see that it follows the spec.. google around...  and you might as well file a bug now in any case if everything else doesn't have the same problem.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #2 - Posted 2003-11-06 22:38:51 »

pngcheck says that both files are ok. I also used a hex editor to create a broken file and indeed pngcheck reports it as broken.

Well... I won't file a bug report, because I don't know where, I don't remember my login, the request login stuff doesn't work and because I don't want to register again.

In addition the bug report pages aren't shown correctly in *any* of my browsers. It seems to depend on my resolution (800x600). Also searching something on Sun's pages always gives me a headache... and I already have one.

You're welcome to do that if you want to Smiley

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #3 - Posted 2003-11-06 22:39:48 »

Not the 1st bug i've seen in Javas PNG codec,

Does it exhibit the same behaviour if you use ImageIO.read()? (I would test it myself.... but its late Tongue)

also, does using a 'proper' Toolkit (as in 1 returned from a specific component, rather than Toolkit.getDefaultToolkit()) give correct results? (I doubt it will make any difference - but u never know Tongue)

I'd guess its the PNG codec not handling a 16color pallette properly.

As I said earlier, its not the 1st codec bug i've seen in Java, GIF images with the transparency color not at index 0 also behave incorrectly under certain circumstances.
/me searches for the Thread....
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1061208332;start=0#0

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #4 - Posted 2003-11-06 22:53:23 »

Quote
[...]
Does it exhibit the same behaviour if you use ImageIO.read()? (I would test it myself.... but its late Tongue)
[...]


It works with ImageIO...  duh Shocked

Hadn't thought that they use different decrunching methods (because it doesn't make any sense).

弾幕 ☆ @mahonnaiseblog
Offline jtr

Senior Newbie




I love YaBB 1G - SP1!


« Reply #5 - Posted 2003-11-07 01:11:54 »


Well... I won't file a bug report, because I don't know where, I don't remember my login, the request login stuff doesn't work and because I don't want to register again.


The JDC request/reset login does ork, but for some reason it takes days for it to arrive in the inbox.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #6 - Posted 2003-11-07 07:01:35 »

Quote

Well... I won't file a bug report, because I don't know where, I don't remember my login, the request login stuff doesn't work and because I don't want to register again.


The JDC request/reset login does ork, but for some reason it takes days for it to arrive in the inbox.


In the last 5 years, there has only been a period of about 4-6 months where a jdc login was required to log a bug, AFAIAA. Certainly, I've logged more than 50 bugs in that time, without ever using a JDC login.

I complained bitterly when they made logins compulsory late last year / early this year. I got the one response I didn't expect: "But it's always been that way....I've checked with the JDC team and they say you've always had to login".

It took many weeks of me insisting I wasn't insane, and that I could probably find thousands of people who would back me up, before the login requirement just one day vanished again. The contact at sun responsbile for my bug was particularly helpful - apparently he had to argue the case internally for quite a long time.

To quote Pratchett:
  "I got nothing against [Sun]...it's just that --"
  "I know, I know," said Lezek. "He couldn't find his arse with both hands."

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #7 - Posted 2003-11-07 12:11:01 »

I've never had a problem with filing bugs or searching for them either.  If you want it fixed, file the bug.

I hate it when you happen to overhear your customers complaining about a problem you never knew you had because nobody ever bothered to tell you, particularly when it would be a simple fix.  Man, I hate that.  Tell Sun.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #8 - Posted 2003-11-07 14:50:35 »

Quote
I've never had a problem with filing bugs or searching for them either.  If you want it fixed, file the bug.

I hate it when you happen to overhear your customers complaining about a problem you never knew you had because nobody ever bothered to tell you, particularly when it would be a simple fix.  Man, I hate that.  Tell Sun.


If I want to file a bug I've to check if it was already mentionend. Searching and reading of an unknown number of bug reports... since they aren't properbly displayed in my browser I would have to read the source of the pages - that means usually a lot of horizontal scrolling... that's so much fun.

All I wanted to is pointing that bug out (validate and checking on other platforms)... the actual bug filing should be done by someone else, who can do that without a pain in the arse, writes good english and doesn't sound that mean and pissed of as I do Smiley

弾幕 ☆ @mahonnaiseblog
Offline trembovetski

Senior Member




If only I knew what I'm talking about!


« Reply #9 - Posted 2003-11-10 06:13:39 »

Happy to report, it's fixed in 1.5..
There were a lot of fixes in this area..

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #10 - Posted 2003-11-11 17:08:24 »

Oh sure make it easy for him!  He doesn't even have to report the bug and it gets fixed anyway Tongue

Really looking forward to seeing a 1.5 beta/EA release...

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #11 - Posted 2003-11-12 21:29:04 »

Quote
Oh sure make it easy for him!  He doesn't even have to report the bug and it gets fixed anyway Tongue
[...]


You said, that you don't have any probs with filing a bug report, but I do have problems with that... I even tried to explain the details.

Arguing won't magically enhance my monitor nor the login-request thingy would begin working.

All I did was asking for a small "never had a problem with"-favour, but you are right. It's my bug and my fault (because I found it) therefore I have to report it even if it takes 10 to 20 times longer if I have to do it.

Yea... I'm sucha lazy SOB. Coding 10 hours per day, doing stuff for 2 modifications and administrate a board with over 17k registered users just doesn't cut it.

See? I always sound pissed off. Well... ok this time it's intentional Tongue

@ trembovetski

Thanks for the info Smiley

弾幕 ☆ @mahonnaiseblog
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #12 - Posted 2003-11-12 23:52:21 »

Seriously, what system are you using that has so many problems with the Java bug reporting pages?

I wouldn't make that much effort either Grin - I just don't get why it's like that for you???.  You seem to have a broken system.  I've reported Java bugs on Windows, with IE, Opera, Mozilla, Firebird;  on Linux with Mozilla, Opera; on Mac with Safari...   and I have never had a problem with the site.
Just for the heck of it I started the process using Konqueror and it seemed to be working fine... :-/

Maybe you are referring to the problem when browsing bug reports with the bug report text not wrapping so you have to make the browser window wide to view it?  I DO get that  - but I just make the window big enough and it isn't a problem.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #13 - Posted 2003-11-13 00:50:44 »

As if you could make the window big enough if you have to use 800x600 Roll Eyes

(A new monitor is on first place on my toBuy list).

And my system is fine, thanks Wink

弾幕 ☆ @mahonnaiseblog
Offline MGodehardt

Junior Member




why does the chicken cross the road?


« Reply #14 - Posted 2003-11-13 13:03:03 »

why do u use png ? i never used png or gif format, i use my own format and never had problems with it, its much smarter
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #15 - Posted 2003-11-13 13:15:51 »

Quote
have to use 800x600

Quote
And my system is fine, thanks Wink

These two statements contradict each other  Grin


As for why use PNG? A better question is why not?  It is built-in to the JRE and is a generally decent lossless format that supports most of what you would ever need.  The world does not need yet another 2d graphic file format, there are already too many.

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #16 - Posted 2003-11-13 14:19:11 »

Quote


As for why use PNG? A better question is why not?  It is built-in to the JRE and is a generally decent lossless format that supports most of what you would ever need.  The world does not need yet another 2d graphic file format, there are already too many.


Ahem. I'm still awaiting JPG-2000, and full-on wavelet compression. (...and I've been waiting for many years Sad )

c.f. http://jpeg2000.epfl.ch/ for a basic java implementation.

But, agreed, until it arrives (they finish writing the standard, and it gets wide support, etc), PNG is probably the best lossy format (nb: not good IMHO for lossless compression - tools and users have a habit of using the lossy compression, which is a PITA when unwanted and the original file gets overwritten. TGA etc are at least *safe* in this regard...)

EDIT: FYI JPEG-2000 provides lossless compression at similar ratios to much of the decent-quality lossy compression. It's rather good Smiley

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #17 - Posted 2003-11-13 14:31:26 »

You can use JPEG 2000 now with ImageIO if you download the IO pack for JAI.  I'm not sure if the IO pack is released now (not early access) so that you can distribute it with your apps... I think so, but would have to check to be sure.

PNG is not lossy, it has no option for being lossy.  So as for being the best lossy format Huh

JPEG 2000 is good... very good at vary high lossy compresson ratios.. but the format is also very complex.  Or perhaps better stated it can be very complex, supporting regions of interest and tiles etc..

I have not seen any thing to compare it's performance with lossless compression, but I believe that it would do well.

JPEG 2000 is also rather slow to encode/decode, probably simply because the current implementations have not matured.

It just so happens that the company I work for is using JPEG 2000 hardware for a high definition video product (with a nice cross-platform Java UI).  So if you know of some good & fast JPEG 2000 codecs I'm particularly interested.

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #18 - Posted 2003-11-13 16:03:22 »

Quote
You can use JPEG 2000 now with ImageIO if you


Yup, but ask an artist to produce that format and you're just going to get funny looks Sad. The standard itself is also not finished, and the reference implementations appear to be pretty crude (only the most basic support so far, because the extensions haven't been fully defined yet?)

Quote

PNG is not lossy, it has no option for being lossy.  So as for being the best lossy format Huh


Now that you say that, and I've thought about it a bit more...sorry, I was being stupid Smiley. I'm not sure what I was thinking of, except that I remembered I'd had problems before with being supplied low-quality PNG's. My best guess is that we were being given JPG's that were being converted to PNG too late in the production process. Hmm.

It's been a long time since I looked at PNG's in technical terms. Oops.

Quote

JPEG 2000 is good...


I had a Professor who was an expert on Wavelet compression, and I've still got a big stack of notes from his lectures. I spent more time than I care to recall looking at wavelets and working through the maths behind them...

But since nearly all of us aren't ever going to (need to) write our own codecs, like other "difficult" algos (MPEG-4?) most of us will never need to worry about complexity, except where it hogs CPU power...?

malloc will be first against the wall when the revolution comes...
Offline rreyelts

Junior Member




There is nothing Nu under the sun


« Reply #19 - Posted 2003-11-13 22:13:35 »

Quote
It just so happens that the company I work for is using JPEG 2000 hardware for a high definition video product (with a nice cross-platform Java UI).  So if you know of some good & fast JPEG 2000 codecs I'm particularly interested.


Several years ago, I worked for a company writing medical imaging software that used wavelet-based compression techniques to work with large videos like angiograms/cardiograms, etc... The stuff people usually provide in DICOM format.

Anways, one of the guys I worked with was a graduate from Georgia Tech's PhD EE program in DSP - which is pretty much reknown for being top of class. I could hook you two up. He might have a pretty good idea  of how you go about obtaining a good JPEG2000 implementation. Send me an e-mail if you're interested - toby@reyelts.com.

As a side note, yes, JPEG2000 should do lossless compression pretty darn well, as it's based on the same wavelet-based techniques that we were using for our own proprietary lossless codec.

God bless,
-Toby Reyelts

About me: http://jroller.com/page/rreyelts
Jace - Easier JNI: http://jace.reyelts.com/jace
Retroweaver - Compile on JDK1.5, and deploy on 1.4: http://retroweaver.sf.net.
Offline MGodehardt

Junior Member




why does the chicken cross the road?


« Reply #20 - Posted 2003-11-14 10:12:30 »

i use my own image format and the size of my images is much much smaller then png or gif or jpg or jpg2000.
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #21 - Posted 2003-11-14 22:46:23 »

Quote
i use my own image format and the size of my images is much much smaller then png or gif or jpg or jpg2000.


PNG can be very small. The PNGs from Photoshop aren't.

If you really want small PNGs you have to use tools wich really try everything possible to make em (lossless) smaller.

I use PNGCrush and PNGOut. PNGOut takes ages but it can easily shrink an image from 68kb to 42kb.

>why do u use png ?

Because I want to. If I make a very small game. 42kb alltogether (2 classes, 5 images and 3 sounds) then it won't make any sense to even think about writing my own image format... the loader would be at least 3-4 times bigger than the "saved" space.

Sometimes a game has just some small graphics... then it just isn't worth the pain.

@blahblahblahh

>Yup, but ask an artist to produce that format and you're
>just going to get funny looks Sad.

/me looks at blahblahblahh like a car (but not that fast) Shocked

Heh... seriously I don't have a clue how to produce jpeg2000 images and I even don't care much. However I'm looking forward the day it get's "mature" Smiley

Btw animated avatars are imo distracting. I would be nice if you change it, because I (usually) like reading your posts.

弾幕 ☆ @mahonnaiseblog
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #22 - Posted 2003-11-15 01:42:53 »

Quote

The standard itself is also not finished

I think if you check the standard for still images is finished.  There are other sections left to complete.

Check http://www.jpeg.org/JPEG2000.html
"JPEG 2000 refers to all parts of the standard: Part 1 (the core) is now published as an International Standard, five more parts (2-6) are complete or nearly complete, and four new parts (8-11) are under development... "

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #23 - Posted 2003-11-15 01:52:24 »

Quote
Yup, but ask an artist to produce that format and you're just going to get funny looks Sad.

So?  The artist can just deliver a lossless image format - like PNG then you can convert to JPEG2000 for your own purposes.. adjusting compression/quality tradeoffs as the project requires.  

You can whip up a quick Java app with ImageIO to do the conversions, or use something like IrfanView or photoshop plugins etc.

I wonder how lossless lossless JPEG 2000 really is?  What about simple rounding errors? Can you go in and out of JPEG2000 lossless 1000 times without accumulating rounding error?   Theoretically regular JPEG should only lose information once - during the initial quantization phase.. re-compressing with the same parameters should yield the exact same image because the quantization should do nothing if applied again.. but in practice you will accumulate error due to rounding / smoothing, etc.

That's why I like PNG - it doesn't do anything with fractions that might lead to accidental loss.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (51 views)
2014-04-15 18:08:23

BurntPizza (48 views)
2014-04-15 03:46:01

UprightPath (63 views)
2014-04-14 17:39:50

UprightPath (45 views)
2014-04-14 17:35:47

Porlus (62 views)
2014-04-14 15:48:38

tom_mai78101 (86 views)
2014-04-10 04:04:31

BurntPizza (146 views)
2014-04-08 23:06:04

tom_mai78101 (243 views)
2014-04-05 13:34:39

trollwarrior1 (202 views)
2014-04-04 12:06:45

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!