Skip to content

Instantly share code, notes, and snippets.

View Anthony-Hoo's full-sized avatar

Anthony-Hoo Anthony-Hoo

View GitHub Profile
@Rachel030219
Rachel030219 / picture_to_cie_telebot.py
Created December 29, 2023 03:02
A Telegram bot used to draw CIE 1931 Chromaticity diagram out of image files.
import os
import telebot
import config
import picture_to_cie_diagram
from telebot import apihelper
from urllib3 import ProxyManager
bot = telebot.TeleBot('<TOKEN>')
@Rachel030219
Rachel030219 / picture_to_cie_diagram.py
Last active March 18, 2024 07:11
Converts image to CIE 1931 Chromaticity diagram
"""
Copyright (C) 2024 Rachel030219
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@Anthony-Hoo
Anthony-Hoo / picture_to_cie_diagram.py
Created December 19, 2023 06:51
Converts image input to CIE xy chromaticity coordinates with original pixel colour
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import time
from colour.plotting import *
def plot_xy_coordinates_with_color(xy_and_rgb_np, output_png_path):
start_time = time.time()
xy = xy_and_rgb_np[:, :2]