How do you make this?
>>>>>>>>>>>>>>>>/gd/
>>58493672
by using hard work, dedication and meme magic
pacman -S cowsay
cowsay 'nigger'
>>58493672
It's an autism thing
you don't "make" meme magic it just flows through the internet
>>58493672
here's a quick examplefrom PIL import Image, ImageDraw, ImageFont
charset = "^_`abcdefghijklmnopqrstuvwxyz~*+-.:<=>{}0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ#$%&"
font_size = 18
font = ImageFont.truetype("Consolas.ttf", size=18)
char_w, char_h = font.getsize("#")
ima = Image.open("pepe.png")
imb = Image.new("RGB", ima.size, (0, 0, 0))
ima = ima.resize((ima.size[0] / char_w, ima.size[1] / char_h))
dc = ImageDraw.Draw(imb)
for y in range(ima.size[1]):
for x in range(ima.size[0]):
r, g, b = ima.getpixel((x, y))[:3]
r = int(r / 6) * 6
g = int(g / 6) * 6
b = int(b / 6) * 6
n = (r + g + b) / (255.0 * 3)
ch = charset[int((len(charset) - 1) * n)]
dc.text((x * char_w, y * char_h), ch, fill=(r, g, b), font=font)
imb.format = "PNG"
imb.save("pepe2.png")
>>58495186
>imb.format = "PNG"
amazing API
>>58495397
you can pass it to the save method directly to make it look less retarded, as I've just found out
I guess it's mainly there to determine the format when you open an image, not the other way around
>>58493672
just use libcaca
>>58495186
>r = int(r / 6) * 6
Why?
>>58495520
To get that authentic 216-color feel (6-6-6 RGB).
One could also include 24 grayscale values to reach xterm's 240 colors.
>>58495186
>python is shit
>you cant do anything with it
>>58495186
how about gif
>>58495616
nvm i managed to do it
>>58495648
rarest pepe
>>58493672
aalib
>>58495719
Thank you!
>>58495648
can you share the code?
>>58495819
not code upload your gif to here
https://www.phpsecure.info/gifanimscii.php
>>58495186
this is fun
dumb frogposter
>>58495586
There are many things you can do with Python, but it doesn't make Python less shit.
>>58495186
>>58495616
cleaned it a little and added gif supportfrom PIL import Image, ImageDraw, ImageFont, ImageSequence
import sys
charset = "^_`abcdefghijklmnopqrstuvwxyz~*+-.:<=>{}0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ#$%&"
font_size = 10
font = ImageFont.truetype("Consolas.ttf", size=font_size)
char_w, char_h = font.getsize("W")
def process_image(im):
size = im.size
im = im.convert("RGB")
im = im.resize((im.size[0] / char_w, im.size[1] / char_h))
out_im = Image.new("RGB", size, (0, 0, 0))
dc = ImageDraw.Draw(out_im)
for y in range(im.size[1]):
for x in range(im.size[0]):
r, g, b = im.getpixel((x, y))
r = int(r / 6) * 6
g = int(g / 6) * 6
b = int(b / 6) * 6
n = (r + g + b) / (255.0 * 3)
ch = charset[int((len(charset) - 1) * n)]
dc.text((x * char_w, y * char_h), ch, fill=(r, g, b), font=font)
return out_im
def main():
try:
filename = sys.argv[1]
out_filename = sys.argv[2]
except IndexError:
print "Usage: %s <input file> <output file>" % sys.argv[0]
return
im = Image.open(filename)
if im.format == "GIF":
frames = []
for frame in ImageSequence.Iterator(im):
frame = process_image(frame)
frames.append(frame)
frames[0].save(out_filename, format=im.format,
save_all=True, append_images=frames[1:],
loop=im.info["loop"], duration=im.info["duration"])
else:
pim = process_image(im)
pim.save(out_filename, format=im.format)
im.close()
if __name__ == "__main__":
main()
>>58495825
noice