• Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedImage to byte[]

 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I convert from java.awt.image.BufferedImage to a byte[]?

Thanks.
[ June 18, 2006: Message edited by: Namitha karupaiya ]
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply.

But I could not find a method which accept BufferedImage as a parameter and returnes a byte[].

I guess this has to be done by several steps which I could not do.

Any further help is very much appreciated.

Thanks.
[ June 19, 2006: Message edited by: Namitha karupaiya ]
 
Paul Clapham
Sheriff
Posts: 21872
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Several steps, yes. Joe already pointed out the first step:Now you have a ByteArrayOutputStream. I will leave it to you to design the second step, where you get a byte array from that.
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still confusing what a format name is in the write method:



What is that formatName? Please help me one step more.

Thanks.
 
Paul Clapham
Sheriff
Posts: 21872
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the documentation? What does it suggest to you? What have you tried so far?
 
Nesan Krish
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Namitha !

Have you got the solution now? I have many years experience in image processing software development. I am working for a well known company in the field. I can help you.

Waiting for your reply......

Take care. Bye for now......
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nesan Krish !!

Its pleasing to hear from you.

Could you please give a complete solution to my original question.

Thank you very much.
 
Paul Clapham
Sheriff
Posts: 21872
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namitha, I just had a look through the API documentation and I found this static method in the ImageIO class:
public static String[] getWriterFormatNames()

Returns an array of Strings listing all of the informal format names understood by the current set of registered writers.
Since your question is what informal name you should be using, I would suggest that running this method and finding out what it returns might give you some useful information. In general I would suggest that you read the documentation and try things that you don't understand. Waiting for strangers to write your code for you is going to be a slow process and you shouldn't rely on it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!