add note about palette sorting by quantisers

This commit is contained in:
John Cupitt 2022-05-26 17:41:51 +01:00
parent 550781cd18
commit 2af2ca5ca2

View File

@ -403,6 +403,11 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in )
entry->blue = p[2];
plte.n_entries += 1;
/* Quantizr and libimagequant sort the pallette
* by transparency, so trns.type3_alpha[] and
* plte.entries[] will use the same indexing.
*/
g_assert( i == 0 || p[3] >= p[-1] );
if( p[3] != 255 ) {
trns.type3_alpha[trns.n_type3_entries] = p[3];
trns.n_type3_entries += 1;