mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-03 07:23:41 +03:00
Fix rounding error on RGB to L conversion
This commit is contained in:
parent
302b86591e
commit
d68147ce89
|
@ -44,7 +44,8 @@
|
||||||
#define L(rgb)\
|
#define L(rgb)\
|
||||||
((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114)
|
((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114)
|
||||||
#define L24(rgb)\
|
#define L24(rgb)\
|
||||||
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471)
|
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471 + 0x8000)
|
||||||
|
|
||||||
|
|
||||||
#ifndef round
|
#ifndef round
|
||||||
double round(double x) {
|
double round(double x) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user