Compare commits

..

No commits in common. "0b52e781e38cca81cdf2fc98559392f444c8ed71" and "be91a07dd5544a424de95247c46480e6c8607f2d" have entirely different histories.

View File

@ -1,34 +1,15 @@
from PIL import Image
from utils import Color
from tqdm import tqdm
def getImageByColor(color):
return Image.open(f'means/mean_flat-field_nef_wavelet_{color}.png')
def getImageFileNameByColor(color):
return f'mean_flat-field_nef_wavelet_{color}.png'
color = Color.BLUE
image = getImageByColor(color)
width, height= image.size
image = Image.open(getImageFileNameByColor(color))
#print(image.size)
multipleColorsImage = Image.new('RGB', [dimension * 2 for dimension in image.size])
newImage = Image.new('RGB', [dimension * 2 for dimension in image.size])
#print(newImage.size)
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')
for color in Color:
getImageFileNameByColor(color)