Compare commits

...

3 Commits

View File

@ -1,15 +1,34 @@
from PIL import Image
from utils import Color
from tqdm import tqdm
def getImageFileNameByColor(color):
return f'mean_flat-field_nef_wavelet_{color}.png'
def getImageByColor(color):
return Image.open(f'means/mean_flat-field_nef_wavelet_{color}.png')
color = Color.BLUE
image = Image.open(getImageFileNameByColor(color))
#print(image.size)
image = getImageByColor(color)
width, height= image.size
newImage = Image.new('RGB', [dimension * 2 for dimension in image.size])
#print(newImage.size)
multipleColorsImage = Image.new('RGB', [dimension * 2 for dimension in image.size])
for color in Color:
getImageFileNameByColor(color)
for color in tqdm(Color, 'Color'):
colorImage = getImageByColor(color)
for y in tqdm(range(height), 'Height'):
for x in range(width):
pixel = colorImage.getpixel((x, y))
'''
RG
GB
'''
newX, newY = {
Color.RED: (x, y),
Color.GREEN_RIGHT: (x - 1, y),
Color.GREEN_BOTTOM: (x, y - 1),
Color.BLUE: (x - 1, y - 1),
}[color]
newX *= 2
newY *= 2
multipleColorsImage.putpixel((newX, newY), pixel)
multipleColorsImage.save('multipleColors.png')