With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.
Fixes#730
This fixes a problem generating invalid RGBA entries for an optimized
palette. (E.g. Generating non-opaque pixels when we feed the algorithm
only with opaque pixels.)
- Correct usage of disposal methods (and possibility to generate records
with "restore previous frame" disposal method)
- Create color maps for each frame when necessary
- Remove options to dither RGB images (to simplify encoder)
- Better palette creation depending on local colormaps
- Reuse palette colors from previous frames
- Use frame transparent index correctly
- Convert to RGB automatically if the image has more than 256 colors
- Remove onPostLoad()
- Add progress bar feedback
There are gif files that use a subset of the original color map remapping
used entries into first indexes. E.g. the main palette contains 256 colors,
but then a frame can use 4-bit per pixel to reference 16 colors from the
original 256 color palette.
When we converted an Indexed image to RGB, the original sprite
transparent color was being kept but the mask color of all its images
was reset to 0. With this change we kept the same mask color on all images
to avoid an assert() in the render code.
Anyway the whole RGB <-> Indexed conversion should be reviewed in these
cases. I think there are some situation where a transparent color = 0 is
expected in RGB sprites (as we shouldn't be able to change the transparent
color of an RGB sprite).
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.)