Welcome, Guest. Please login or register.

Author Topic: Uncompressed Graphic Format  (Read 1152 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline HardboyTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 248
    • Show only replies by Hardboy
Uncompressed Graphic Format
« on: April 08, 2003, 10:59:56 PM »
Hi,

I´m searching for am uncompressed graphic file format. Does anyone know a simple one? I´d prefer a format which stores pixels in RGB.

 

Offline olegil

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 955
    • Show only replies by olegil
Re: Uncompressed Graphic Format
« Reply #1 on: April 08, 2003, 11:07:08 PM »
ILBM? (IFF interleaved bitmap)

TIFF? (tag image file format)

PPM? (Portable Pixel Map) (search for ppm and netpbm)

That being said, I don't think you can get much simpler than uncompressed IFF if you're programming for Amiga. If you're talking Linux, I would suggest PPM, since there's a ####LOAD of applications that support this out of the box, and the format is totally open.
If we're talking Windows, I might be persuaded to suggest TIFF. It's well supported under AmigaOS and Linux as well, so really isn't that bad. I don't know how good the documentation is, though. There's some libraries you can use...
 

Offline HardboyTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 248
    • Show only replies by Hardboy
Re: Uncompressed Graphic Format
« Reply #2 on: April 08, 2003, 11:14:27 PM »
Thanks!

It really doesn´t matter how supported it is. It´s because I´m testing some compressing techniques, and need some simple format to load and store results in. Documentation and simple layout is most important.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Uncompressed Graphic Format
« Reply #3 on: April 08, 2003, 11:17:06 PM »
Hi,

For true colour images, PPM is by far the simplest. For greyscale, PGM is the way to go.

PPM has an ASCII header with the following structure

P6


255


From a C perspective, reading the header is a simple as using

int width, height;
fscanf(fileName, "P6\n%d\n%d\n255\n", &width, &height);

The data is stored as triplets of bytes (red green and blue respectively), one for each pixel and follows immediately on the line after the '255' value.

PGM is very similar:

P5


255


So you could use the following to read the header

int width, height;
fscanf(fileName, "P5\n%d\n%d\n255\n", &width, &height);

Here the data consists of single bytes representing a grayscale value of 0-255.

I can't think of a simpler pair of formats that can be used within any serious image manipulation package.
int p; // A
 

Offline olegil

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 955
    • Show only replies by olegil
Re: Uncompressed Graphic Format
« Reply #4 on: April 08, 2003, 11:17:06 PM »
Here's the good old RTFM response :-)
uncompressed ilbm doc

ppm docs

libtiff docs


Good luck. And if you choose uncompressed BMP instead of these 3 choices, I'll kill ya. Ok, so I won't kill you, but I'll get pretty mad at ya :-)
 

Offline olegil

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 955
    • Show only replies by olegil
Re: Uncompressed Graphic Format
« Reply #5 on: April 08, 2003, 11:19:00 PM »
@Karlos:

Well, if you're on the Amiga IFF is _kind_ of standard, so it makes sense to use that. Then the user could use the pictures in ANY other program. I like netpbm, though.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Uncompressed Graphic Format
« Reply #6 on: April 08, 2003, 11:22:46 PM »
Quote

olegil wrote:
@Karlos:

Well, if you're on the Amiga IFF is _kind_ of standard, so it makes sense to use that. Then the user could use the pictures in ANY other program. I like netpbm, though.


Perhaps, but he did ask for the simplest uncompressed formats with RGB pixels. AFAIK, you can't get simpler than ppm :-) Well, raw is simpler but not much use!
Besides, pgm/ppm is supported by all the amiga graphics apps that I know (apart from dpaint). Plus it works on lots of other platforms too.
int p; // A
 

Offline olegil

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 955
    • Show only replies by olegil
Re: Uncompressed Graphic Format
« Reply #7 on: April 08, 2003, 11:28:23 PM »
Yep. PPM is dead simple. But so is IFF. You need to add a header in both cases.