5
votes
1answer
70 views

Fastest way to count non-zero pixels using Python and Pillow

I have a Python script that creates a diff of two images using PIL. That part works fine. Now I need to find an efficient way to count all the non-black pixels (which represent parts of the two images ...
1
vote
0answers
17 views

Editing Surfaces Removing Color

So I have recently tried to load an image and save it, but remove all of a certain color. I'm running the program and it is running really slow, is there a more efficient way to edit an image? My code ...
2
votes
1answer
46 views

How can I enhance my jigsaw puzzle solver function?

I'm working on writing code which gets several pieces of an image, and reconstructs them to one whole picture. The images are represented by matrices, and two pieces should be "glued" if the right ...
1
vote
1answer
317 views

Recording timeback seconds of video based on compared pixels from an image

The code reads from the screen, compares a pixel in a previously provided sample image and, if the pixels match, it records timeback seconds of video leading up to it. The output is put into a folder ...
8
votes
2answers
187 views

Commenting and naming variables in Python

I am struggling with commenting and variable naming. My teacher says my comments need to be more explanatory and explicit. He says my variable names are also sometimes confusing. I was just wondering ...
2
votes
2answers
2k views

Download image links posted to reddit.com

This is a Python script to save imgur pictures posted to reddit.com forums. I'm looking for an assessment on the design of this script and any web security issues that might exist. Obvious ...
2
votes
0answers
97 views

Script for obtaining images from an IP security camera

I am fairly new to Python and programming in general so I hope the code in this post is not too messy. I have the following code which I use for taking images from an IP security camera: ...
10
votes
1answer
327 views

Rotating greyscale images

For educational purposes I wrote a little piece of code to rotate greyscale images as "low level" as possible, that is, not using any rotate() function, but doing ...
6
votes
1answer
199 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. I have managed to do this, but I would like to learn how I ...
8
votes
2answers
93 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. It has ...
4
votes
1answer
185 views

JPEG extraction script

Here is a program that I've wrote to extract JPEGs from a file. It reads a file that contains the image data and separates it into individual images. ...