mirror of
https://github.com/LearnOpenGL-CN/LearnOpenGL-CN.git
synced 2025-08-22 20:25:28 +08:00
Rewrite 04-01
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"""
|
||||
|
||||
from PIL import Image
|
||||
from os.path import splitext
|
||||
|
||||
file_name = input("Filename: ")
|
||||
r, g, b, a = map(int, input("Color(R G B A): ").split())
|
||||
@@ -32,4 +33,4 @@ for x in range(0, img.size[0]):
|
||||
if pixel[x, y] == (r, g, b, 255):
|
||||
img.putpixel((x, y), (0, 0, 0, 0))
|
||||
|
||||
img.save('noBG.png')
|
||||
img.save(splitext(file_name)[0] + '_noBG.png')
|
||||
|
Reference in New Issue
Block a user