Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 35298

This tag is for questions related to the loading, formatting, saving, compression, and display of data representing pictures.

6 votes
1 answer
2k views

Getting list of colours from image in lab format

I need to write a bit of code that will get a list of the RGB colours in an image and then translate them into a NumPy array of lab colours. … from skimage.color import rgb2lab from skimage.io import imread import numpy as np from PIL import Image # @UnresolvedImport def get_histogram (img): #histogram = plt.hist(img.flatten(), bins=100 …
sleepingbeauty's user avatar
10 votes
2 answers
664 views

Recolour a shape

I am starting with a starting colour, a target colour and a starting position in an image. I want to change every contiguous pixel if it is close to the starting colour. Imagine a stop sign. … from colormath.color_objects import RGBColor import Image def floodFill(x,y, d,e,f, g,h,i, image): toFill = set() alreadyfilled = set() toFill.add((x,y)) image = Image.open(image) …
sleepingbeauty's user avatar