Fix colors for PSDs (#1449)
* Fix colors for PSDs `HydrusImageHandling.DequantizeNumPyImage` should only be applied to images that are BGR (eg those directly from opencv). PIL produces RGB images already so this was inverting the colors on PSD thumbnails. Instead we use `HydrusImageHandling.DequantizePILImage` to handle edge cases. * Dequantize the PSD PIL image before resizing
This commit is contained in:
parent
b4afedb617
commit
59b01d7106
|
@ -44,14 +44,13 @@ def GenerateThumbnailNumPyFromPSDPath( path: str, target_resolution: typing.Tupl
|
|||
if clip_rect is not None:
|
||||
|
||||
pil_image = HydrusImageHandling.ClipPILImage( pil_image, clip_rect )
|
||||
|
||||
pil_image = HydrusImageHandling.DequantizePILImage( pil_image )
|
||||
|
||||
|
||||
thumbnail_pil_image = pil_image.resize( target_resolution, PILImage.LANCZOS )
|
||||
|
||||
numpy_image = HydrusImageHandling.GenerateNumPyImageFromPILImage(thumbnail_pil_image)
|
||||
|
||||
numpy_image = HydrusImageHandling.DequantizeNumPyImage( numpy_image )
|
||||
|
||||
return numpy_image
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue