Jump to content

creating a jpeg

- - - - -

  • Please log in to reply
4 replies to this topic

#1
eafkuor

eafkuor

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 218 posts
Let's assume that I want to create a jpeg image and I know the argb value I want to give to every pixel.
How can I do that? It is ok if I have to write the file a byte at a time; the problem is just that I don't know how a jpeg file is structured.
Any help?
A bmp would be ok too, I just need a fast way to build images!

#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 763 posts
Due to popularity of both JPEG and BMP formats, I believe you would already had support for them in any high level programming language. So, what is your language?

Anyhow, JPEG is similar with BMP. Both are two dimensional array of colors. JPEG simply add compression algorithm to minimize the size. While with BMP there are only two size optimizations you could, either using smaller color depth (reducing the size of the color definition) or using palette (where the 2 dimensional array does not contain the color definitions but pointers or indexes of color definition).

#3
eafkuor

eafkuor

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 218 posts
I will probably use Java.
I'll try to do something with the help of this!

#4
abzero

abzero

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 217 posts
Have a look at: Wotsit.org

It lists alot of the file formsts. However certain languages might have issues with writing the format correctly if you don't have good control
over datasizes.

#5
eafkuor

eafkuor

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 218 posts
Thanks, I solved the problem anyway :D




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users