Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Set unused bytes to zero when converting to LA/La/PA

Open radarhere opened this issue 2 years ago • 1 comments

Inspired by @homm's comment https://github.com/python-pillow/Pillow/pull/7260#discussion_r1254128299, when converting to LA/La/PA, this sets the two middle channels to zero.

This shouldn't make any functional difference at the moment, just improving clarity, and perhaps a small improvement in speed by replacing *out++ = (UINT8)pixel with *out++ = 0.

radarhere avatar Jul 11 '23 09:07 radarhere

I personally don't have preferences what to store in unused bytes. Also I guess performance impact should be near zero/

homm avatar Jul 11 '23 10:07 homm