Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  Save png without using AWT?  (Read 1489 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Posted 2007-03-05 22:33:44 »

Does anyone know a way of saving a png image without using awt? ImageIO unfortunately depends on several awt classes. I expect DevIL could, but since thats rumoured to be dissappearing from LWJGL in the future I'd rather not use it. All the other 3rd party libraries I've found seem to have an unsuitable license (commercial or GPL) or have an awt dependancy.

Am I stuck with having to write a png saver by hand? Sad

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #1 - Posted 2007-03-05 23:24:27 »

does it have to be png? you can easily make or find a library which saves in raw or bmp format.
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #2 - Posted 2007-03-06 00:19:29 »

zipped TGA is equal in size to PNG...

So output as TGA then use ZipOutputStream

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2007-03-06 00:29:17 »

Basically this is for the screenshot function in Snowman Village, so zipping a tga isn't practical as the user isn't going to like that much. At the moment writing something to create an uncompressed TGA looks easiest, but it'd be nice to have a proper compressed image rather than something huge.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Kova

Senior Member





« Reply #4 - Posted 2007-03-06 00:39:53 »

I'm just curious, why avoid couple of AWT classes?
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #5 - Posted 2007-03-06 08:09:11 »

native compilation

Offline Eliwood

Junior Member




Stencyl


« Reply #6 - Posted 2007-03-06 21:27:23 »

Does anyone know a way of saving a png image without using awt? ImageIO unfortunately depends on several awt classes. I expect DevIL could, but since thats rumoured to be dissappearing from LWJGL in the future I'd rather not use it. All the other 3rd party libraries I've found seem to have an unsuitable license (commercial or GPL) or have an awt dependancy.

Am I stuck with having to write a png saver by hand? Sad

As already mentioned, your best bet is either to write a custom writer yourself or to find one out there. I had a hard one finding one myself and gave up on the idea. If you do find a non-GPL, non-commercial one, let us all know. Smiley

Offline SimonH
« Reply #7 - Posted 2007-03-06 21:58:59 »

You might find this helpful;

http://www.j2meforums.com/wiki/index.php/PNG_class

It's J2ME code but you can get the idea!

People make games and games make people
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #8 - Posted 2007-03-06 22:23:18 »

Actually... it seems quite easy to do. For screenshots you only need a tiny fraction of the spec... that is... 24bit truecolor (colortype 2), no filter and only 3 chunks (IHDR, IDAT and IEND) + fixed header (8 bytes). util.zip.Deflater takes care of the compression and it also generates the required CRCs on it's way. So... hum... not exactly difficult. Smiley

弾幕 ☆ @mahonnaiseblog
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.

pw (18 views)
2014-07-24 01:59:36

Riven (17 views)
2014-07-23 21:16:32

Riven (14 views)
2014-07-23 21:07:15

Riven (17 views)
2014-07-23 20:56:16

ctomni231 (45 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!