How do I make a script that takes in an image and does this:

How do I make a script that takes in an image and does this:

1. Start at leftmost column of the image
2. Color the entire column white
3. Bucket fill the column red
4. Save the current image
5. Undo changes
6. move over one column
7. Repeat

This is the image I want to run this on. Perhaps you can figure out why.

Other urls found in this thread:

github.com/python-pillow/Pillow/blob/master/PIL/ImageDraw.py#L325
mixtape.moe/
my.mixtape.moe/xhnsua.webm
pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
my.mixtape.moe/gguwdk.mp4
github.com/aatishnn/lszip
my.mixtape.moe/jzxntv.mp4
bpaste.net/show/1ae89847479f
my.mixtape.moe/pvwrbu.ogg
my.mixtape.moe/zyvusx.xcf
twitter.com/NSFWRedditImage

School started back I see

Python
pillow
github.com/python-pillow/Pillow/blob/master/PIL/ImageDraw.py#L325

Literally 10 minutes of work.

>2. Color the entire column white
>3. Bucket fill the column red
why not colour the column red to start off with?
unless you mean bucketfill the entire image red starting in some point in the column?

> Literally 10 minutes of work.

We'll see if I complete it by the time the thread 404s

If you color the column white then the bucket fill will spread across the image

some kind of sierpinski triangle?

for column_index in image.columns:
copy_of_img = img.copy()
for row_index in [0, ..., image.height]:
copy_of_img[column_index, row_index] = (255, 0, 0)
call flood_fill(copy_of_img, (column_index, 0))
copy_of_img.save("column .png")


function flood_fill_white(img, coordinate):
img[coordinate] = (255, 0, 0)
for neighbour in neighbour_pixels(coordinate):
if img[neighbour] is (255, 255, 255):
call flood_fill_white(img, neighbour)

lads

just use paint lol

I got it to generate the images with the white columns

from PIL import Image

origimg = Image.open("image.png")
img = origimg.copy()

black = 0,0,0
red = 255,0,0
white = 255,255,255

for i in range(3): # for every col:
for j in range(1,1024):
xy = i,j
img.putpixel(xy,white);
xy = i,0

# doesn't fucking exist
#img.floodfill(img, xy, red, border=None)

img.save("test3_"+str(i)+".png")
img = origimg.copy()

how do i into bucket fill

Literally copy/paste the function linked here?

Pham we are running

I can here my computer fans going apeshit

Good job, nate.

Fun fact

1024 = 2^10

2^10 * 2 = 2^11 pixels per image

(2^11 pixels per image) * (2^10 frames in gif) = 2^22 * (3 bytes per pixel)

Where do I post a 12 megabyte gif?

mixtape.moe/

That's the worst script I've ever seen.

gif is rendering

Gimp can't handle it we're switching to cli

>Gimp can't handle it
How surprising.

Wicked job nate

Wouldn't be too hard with a bitmap, good luck with any modern format though.

"test3_7.png" should not be after "test3_614.png"

$ls
...
test3_242.png test3_428.png test3_613.png test3_79.png test3_985.png
test3_243.png test3_429.png test3_614.png test3_7.png
...


How do I get it so that the frames are in order when I run

convert -delay 2 -loop *.png animated.gif

If you have Matlab installed, you can do it with that.
Otherwise use python like thia user

Fucking figured it out

Still waiting for nate to deliver

...

I got a better one for you. Extract the sound from this image.

Looks like a fun challenge.
1. center the circle
2. convert its coordinates from polar to rectangular
3. read the value of the gray pixels lines by line
4. reconstruct the sound
I guess?

Your IDE and your os looks painfull to use daily.

LMAO just print it out and put it in your cd drive

OK fuck doing the Gif we're doing a webm

Its more like vinyl

its flood fill is shit but yeah

also hiroshis shit site is not letting me post the code (connection error)

BEHOLD

my.mixtape.moe/xhnsua.webm

Also a nice one I had some time ago:

Print whole file listing of a .zip file somewhere on the internet into STDOUT in less than 2 seconds.

The program cannot download the whole file. Even if zip file is 4 gigs big, it has to print the contents out in less than 2 seconds.
You should expect that the .zip file has not .ZIP file comment in the end of it.

Some .zip file specifications: pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Congratulations, nate. You did it.

BETTER VERSION

GOD'S TEMPLE MUST BE PERFECT

my.mixtape.moe/gguwdk.mp4

So when you said here >Perhaps you can figure out why.
What did you mean?

because it comes from a computer generated formula and is obviously related to the sierpinski triangle/ruler function

That would be:
github.com/aatishnn/lszip

I'm doing this now just for shits and giggles

Solved it in Java my self like 6 years ago. Yours looks more elegant :)

this one is better to be h

my.mixtape.moe/jzxntv.mp4

I managed to do this one.

bpaste.net/show/1ae89847479f
my.mixtape.moe/pvwrbu.ogg

Sounds kind of creepy. Could probably get it to align a bit better by tweaking the numbers.

Meant to reply to

Nice! This sounds surprisingly good in my opinion, I was expecting a lot more noise.

So what's the purpose behind this? Is there a secret image in there?

I think nate just might have autism. This is fine, this thread was fun to follow.

did you expect one of those "translate the binary to ascii" threads?

so is this board a number station now?

bump for interest

> open this in gimp
> my.mixtape.moe/zyvusx.xcf
> select move tool
> click the active layer
> use the arrow keys

That's really cool

Not bad. I like your solution.

Seriously?
Just cat picture.PNG | aplay

Yeah dude you might have to put it on cardboard or something to stabilize but it works.