Skip to content

Commit

Permalink
Merge branch 'illwieckz/png16' into 'master'
Browse files Browse the repository at this point in the history
netradiant: strip 16-bit png to 8-bit, fix TTimo#153

See merge request xonotic/netradiant!206
  • Loading branch information
illwieckz committed Mar 30, 2024
2 parents af2526b + 7a73084 commit 9792d55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/imagepng/plugin.cpp
Expand Up @@ -109,6 +109,11 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
png_set_expand_gray_1_2_4_to_8( png_ptr );
}

// Strip 16-bit to 8-bit
if ( bit_depth == 16 ) {
png_set_strip_16( png_ptr );
}

if ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ) ) {
png_set_tRNS_to_alpha( png_ptr );
}
Expand Down

0 comments on commit 9792d55

Please sign in to comment.