June Progress Jun 21, 2015

Here are some details about the main changes made in these weeks.

Layer blend modes

Layer blend modes are implemented for the next version:

I was looking for a library to do this for me (pixman, oiio, etc.), but almost all libraries I’ve found use premultiplied alpha. In a next post I’ll write about this, at this moment you need to know that we use straight color (non-premultiplied alpha) for alpha compositing.

The implementation of blend modes came from the PDF specification (section 11.3.5) and fixes for Color Dodge and Color Burn modes.

More (and less) than 256 colors

Right now color palettes have 256 colors. Palettes with less than 256 colors show black spots in these empty spaces. In the next version we’ll have a better control over the number of color in the palette:

Indexed images will continue using 8-bit (256 colors), but palettes might contain more than 256 colors. Anyway this change brings new problems and situations that are being tested, e.g. palettes with less than 256 colors but images with indexes referring a color out of the range.

Special color modes

Actually we have two main color modes:

  • RGBA images: each pixel is RGBA and we see the result as RGBA (full-color).
  • Indexed images: each pixel has an index which refers to a palette color, the result is another indexed image, i.e., the output contains only colors from the palette.

But I’m experimenting with some special color modes:

  • Indexed images with RGBA output: Layers are Indexed, but the whole composition outputs a RGBA image. This is possible because blend modes can affect the result, different level of alphas for each palette entry, layer and cel opacity, etc.
  • RGBA images with indexed output: Layers are RGBA, but the output contains only palette colors. It means that all the compositing is done in RGBA, but the final render is dithered automatically in real-time.

The following is a demonstration of this RGBA -> Indexed color mode using a real-time dithering technique (the output is adjusted automatically depending on the number of available colors):

At this moment I’m thinking how to present all these advanced options to the user to avoid confusion. Moreover, we don’t have to forget that RGBA vs. Indexed modes are already a problem for some users. (Some people find the RGBA color mode more intuitive/expected behavior than the indexed one.)

Linux packages

I’ve dedicated a week to Linux distributions. Fixing compilation problems, preparing Virtual Machines, and creating scripts that start a vagrant box, compile, and package automatically.

I already have a working Aseprite package for Ubuntu 32-bit that I’d like to make it run in 64-bit too (same .deb file for both distros). But it needs some adjustments yet. Also I hope to have a working .rpm for Fedora in these days.

See you next week!