Skip to content

Instantly share code, notes, and snippets.

View komackaj's full-sized avatar

Komačka Juraj komackaj

View GitHub Profile
@komackaj
komackaj / gist:6ece1700a05c363771a4
Last active August 29, 2015 14:20
Apply palette
import pgmagick
if __name__ == "__main__":
# load input image and palette
img = pgmagick.Image('origRGBA.png')
palette = pgmagick.Image('palette.png')
# make input image binary opaque - needed for PNG8
img.channelDepth(pgmagick.ChannelType.MatteChannel, 1)