Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
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  
  DevILed eggs and PNGs  (Read 2583 times)
0 Members and 1 Guest are viewing this topic.
Offline anarchotron

Junior Devvie

...precious bodily fluids.

« Posted 2005-07-25 04:14:24 »

Today I switched my texture loader over from using to using the DevIL features.  I find that the images returned from DevIL are highly saturated for some unknown reason.  Is this a known problem?

Here are the comparison screenshots:

Here is the dirt texture as a reference

Here is the super-simple code I use to load:

   protected boolean loadInternal(String filename)
        IntBuffer images = BufferUtils.createIntBuffer(1);
        boolean result = IL.ilLoadImage(filename);

        if (result == false)
            Warning.emit("DataSourceTextureObject.loadFromStream() failed to create image from InputStream");
            return false;

        setDepth((short) IL.ilGetInteger(IL.IL_IMAGE_BPP));
        setWidth((short) IL.ilGetInteger(IL.IL_IMAGE_WIDTH));
        setHeight((short) IL.ilGetInteger(IL.IL_IMAGE_HEIGHT));


        int numPixels = getWidth() * getHeight();
        ByteBuffer data = BufferUtils.createByteBuffer(numPixels * 4);
        IL.ilCopyPixels(0, 0, 0, getWidth(), getHeight(), 1, IL.IL_RGBA, IL.IL_BYTE, data);


        return true;

Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #1 - Posted 2005-07-25 06:08:57 »

Try this image... it should look identical with both loaders.

The difference? I removed the gamma/chroma aux chunks from the png (with pngtweak).

弾幕 ☆ @mahonnaiseblog
Offline whome

Junior Devvie

Carte Noir Java

« Reply #2 - Posted 2005-07-30 10:11:38 »

Where is "pngtweak" util, all MrGoogle gave me was a link to this post :-)
....wait do you mean "TweakPNG" tool found here

Why is gamma/chroma chunks so evil in DevIL library?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #3 - Posted 2005-07-30 17:47:30 »

Ye... tweakpng.

>Why is gamma/chroma chunks so evil in DevIL library?

They aren't really "evil". It's just... they either get interpreted or get ignored. If they aren't existant (they are optional) this issue is completly avoided.

Saving pngs with pngout will also remove all optional chunks (unless specified otherwise).

弾幕 ☆ @mahonnaiseblog
Offline whome

Junior Devvie

Carte Noir Java

« Reply #4 - Posted 2005-07-31 10:39:56 »

Thx, I've now two small png utility installed. I even found pngout.dll plugin for IrfanView image tool.

Pngout site has pngout.dll file to be copied to IrfanView3.97 plugin folder. It provides a nice SaveAs dialog box.
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #5 - Posted 2005-07-31 13:12:33 »

I also use irfanview-version for a while... Before I use the command line thing via send-to, but with irfanview its much nicer to handle, because the options can be nicely accessed and there is transparency and that "finish after this pass" button thingy is also damn nice Smiley

Btw there are several irfanview packs. The bigger one comes with the pngout plugin.

Other nice png programms are pngrewrite and pngquant.

"Pngrewrite is little utility that reduces the unnecessarily large palettes that too many programs write into PNG files. It also optimizes transparency settings, and reduces the bits-per-pixel if possible. Handy for post-processing images before putting them on a web site."

"pngquant is a command-line utility to quantize and dither 32-bit RGBA PNGs down to 8-bit (or smaller) RGBA-palette PNGs, usually with a significant reduction in file size"

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

Coldstream24 (16 views)
2015-09-03 00:41:28

Andrew_3ds (26 views)
2015-09-01 19:08:10

afikri (17 views)
2015-08-31 09:30:22

afikri (25 views)
2015-08-31 09:30:07

afikri (13 views)
2015-08-31 09:27:24

afikri (16 views)
2015-08-31 09:26:40

Roquen (30 views)
2015-08-29 11:30:54

GamerC4 (36 views)
2015-08-22 20:38:50

GamerC4 (33 views)
2015-08-22 20:37:18

GamerC4 (40 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 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‑
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!