0

Can anyone, at least in abstract, describe to me what to do if I have an arbitrary image file (that I know the layout of and other specifications) and I need to convert image files like .jpg, .tga and .png into that format.

ImageIO does not know this format. It's a custom format. I want to create a tool that will be able to work with this format = to be able to write this custom from jpg,png,tga etc.

How do I specify the things like the Header the custom image format is supposed to be saved (written) with?

Example: convert penguin.png into penguin.xyz where .xyz is a custom image format.

My idea: I could input the source image's (any common image file) bitmap data into a buffer, then add the specifications of the custom image file to the buffered image data and then write the new image file (my arbitrary image file).

I've been looking for 3 days, can't find a tutorial for this. Should I tackle this problem once I get some more experience?

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Josef
  • 13
  • 3
  • Possible duplicate of [Image Conversion In Java](https://stackoverflow.com/questions/14618953/image-conversion-in-java) – Villat Oct 09 '19 at 00:30
  • @Villat Thanks for response, been there, seen it, didn't help. To make things more concrete: I'm trying to work with the Valve Texture Format. It's a bitmap image with certain specifications and layout. I can't just export into .vtf when I haven't set what a .vtf is. I know the data of .vtf, I can specify them - I'm guessing after a bitmap had been buffered to be written as the .vtf. But how? What can I use to do that? – Josef Oct 09 '19 at 00:45
  • Hey @plagugin, try first with some example like the one on that post, in order to better understand what's going on with the code, and then you could try to solve your problem :) – Villat Oct 09 '19 at 00:50
  • If you haven’t already, I suggest going through the [Basic I/O](https://docs.oracle.com/javase/tutorial/essential/io/) Java tutorial. – VGR Oct 09 '19 at 03:16
  • @Villat Thanks guys, will do so. – Josef Oct 09 '19 at 15:23

0 Answers0