Jump to content

View more

Image of the Day

The beast has a mighty searchlight of evil! #screenshotsaturday https://t.co/bzKepOojDL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Reading and writing an image file

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1 jenny_wui   Members   

200
Like
0Likes
Like

Posted 24 April 2013 - 03:39 PM

Hello, I would like to read a png file and display it and then again modify some pixel value and write it back. How can that be done? Pleasse provide some advice.



#2 jHaskell   Members   

1842
Like
0Likes
Like

Posted 24 April 2013 - 03:43 PM

You want to do this programmatically?  If so, what language and Environment?

 

Or do you want to do this manually, as in some image editing software like Paint, Paint.NET, GIMP, or Photoshop?



#3 Paradigm Shifter   Members   

5832
Like
2Likes
Like

Posted 24 April 2013 - 03:43 PM

libpng http://www.libpng.org/pub/png/libpng.html is probably your best bet.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#4 jenny_wui   Members   

200
Like
0Likes
Like

Posted 24 April 2013 - 05:19 PM

Thank you very much. I had some mistake. It is a jpg file. I have extracted the header i.e. width and height. Now I would like to read the pixel and display it. Please provide me some suggestion. Thanks.



#5 0r0d   Members   

1876
Like
0Likes
Like

Posted 24 April 2013 - 07:11 PM

Thank you very much. I had some mistake. It is a jpg file. I have extracted the header i.e. width and height. Now I would like to read the pixel and display it. Please provide me some suggestion. Thanks.

Go here:

 

http://www.ijg.org/



#6 Bacterius   Members   

13164
Like
0Likes
Like

Posted 24 April 2013 - 07:24 PM

The JPEG spec is kind of tricky to implement, so unless you really want to know how it works, I'd suggest using an existing library to read and write JPG files.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.