Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » D A T A compression && GIMP C Images

This thread is locked; no one can reply to it. rss feed Print
D A T A compression && GIMP C Images
BAF
Member #2,981
December 2002
avatar

How exactly does data compression work and how could I implement high ratio compression into my program?

And in the GIMP, GNU Image Manipulation Program , how do I display images saved as 'C Source' with allegro?

Bruce Perry
Member #270
April 2000

Quote:

How exactly does data compression work and how could I implement high ratio compression into my program?

It's a huge subject. For generic compression, your best bet is probably to use zlib. For specific types of data, you can look into lossless formats like PNG and FLAC, and lossy formats like JPEG, Ogg Vorbis and Speex. You won't be able to beat these programs unless you are a mad, worryingly smart scientist with no life. ;D

For the GIMP question, include the code in your program. Call create_bitmap(). Then call putpixel() several times. Don't forget destroy_bitmap() at the end.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

BAF
Member #2,981
December 2002
avatar

oh, the c code are the pixels?::)

Bruce Perry
Member #270
April 2000

No. They're aeroplanes.

What did you think they were? :P

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

spellcaster
Member #1,493
September 2001
avatar

Quote:

What did you think they were?

Penguins?
The GIMP was originally a Linux program, so shouldn't it output penguins?

And, as discovered in one of Dirk Gently's books, most of your brain is filled with penguins anyway :)
(I guess it was "long dark tea time of soul")

--
There are no stupid questions, but there are a lot of inquisitive idiots.

X-G
Member #856
December 2000
avatar

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Bruce Perry
Member #270
April 2000

According to Guu, your brain is filled with Manda or little plump pink birds. I forget which. Maybe both, depending on the season.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Go to: