mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-14 17:13:42 -07:00
Converter: fixed degrade color power after 'lct'
This commit is contained in:
parent
ab714dfbfe
commit
7140ee8684
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ from PIL import Image
|
|||
|
||||
#n_colors = [0..256]
|
||||
def reduce_colors (img_bgr, n_colors):
|
||||
img_rgb = (cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB) * 255.0).astype(np.uint8)
|
||||
img_rgb = (img_bgr[...,::-1] * 255.0).astype(np.uint8)
|
||||
img_rgb_pil = Image.fromarray(img_rgb)
|
||||
img_rgb_pil_p = img_rgb_pil.convert('P', palette=Image.ADAPTIVE, colors=n_colors)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue