Saving a file with v1.1, loading it with v1.0, and then loading it back
with v1.1 was generating a layer with flag 32 enabled ("layer has opacity
bit") and opacity = 0 (the opacity was overwritten by v1.0, but the flag
was persisted).
Now the "layers have opacity" bit is saved in the file header. This
flag can be used because v1.0 saves it with value = 0.
With this change we save the new palette chunk when it's necessary, and
the old color2 chunk will be always present only for backward
compatibility. (So we can open a .ase file saved with v1.1 in v1.0.)
In this way the default palette can contain colors with alpha channel.
Also, we migrate the old .gpl to .ase format, removing extra black entries
in the default palette (the old format contains 256 colors, and now we
can handle less colors).
Instead of calling findBestfit() for all RGBA colors in
RgbMap::regenerate(), we mark all entries as invalid, and then we
validate them only when the user require one specific entry from
RgbMap::mapColor(). With this we avoid a lot of unnecessary computations
each time the palette changes.
Now that we have alpha channel in color selector and palette entries, it's
nice to have as a default ink a more pixel-art friendly, i.e.
an ink that just replace RGBA values instead of doing alpha compositing.
Issue #286
This include several changes:
- Color::getIndex() can return palette values with alpha != 255
- Fix Transparent and Blurs ink for indexed images to make better use
of palette entries with alpha values
- Fix bilinear resize algorithm for indexed images with alpha
- New RgbMap with four parameters: R, G, B, A
- Add one extra color scale function used in the alpha channel of the
new RgbMap
- Fix color curve, convolution matrix, invert color, and median filters
to take care of this new alpha channel on indexed images
- Fix ordered dithering and quantization
Related to #286
We've added a new chunk type in .ase files to save palettes with alpha
channel, color name, and palettes with more than 256 colors.
Related to #668, #467, and #286
If we have a palette with few colors (e.g. just one row of colors), we
would like to setup a columns number equal to the whole available
PaletteView width. This is because when we drag colors, we can drop them
in position that are outside the current palette size.