Spade-Editor / Spade

Cross-platform raster graphics editor inspired by Paint.NET
GNU General Public License v3.0
41 stars 10 forks source link

Make new image format which supports layers. #42

Closed HeroesGrave closed 10 years ago

HeroesGrave commented 10 years ago

LBIN to start off with, we can get more complicated later (#43).

HeroesGrave commented 10 years ago

Format details:

    [int]: width
    [int]: height
    {Recursive Structure}: canvas data
        [RGBA array]: image data
        [int]: child count
        {Recurses <child count> times}
    {End Recursive Structure}
    [int]: EOID

Basically, it has the width and height, then the root canvas' image data and child count, followed by each child's image data and child count... etc.

HeroesGrave commented 10 years ago

Btw, I'm going to make a gzipped version before closing this. Raw image data takes up a lot of space.

HeroesGrave commented 10 years ago

Wow. Running gzip on a 12.8MB test lbin file cuts it down to 80 KB, xz gets it to 70KB, bzip2 gets it to 50KB.

Results will of course vary, but that's lots of compression.

Definitely implementing zlbin.

HeroesGrave commented 10 years ago

Also, I haven't got a dialogue working for the LBIN importers/exporters. It's a bit tricky calculating the size.