[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

How do you make this?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 28
Thread images: 9

File: 1484410822414.gif (607KB, 800x792px) Image search: [Google]
1484410822414.gif
607KB, 800x792px
How do you make this?
>>
File: NessSprite.gif (3KB, 180x216px) Image search: [Google]
NessSprite.gif
3KB, 180x216px
>>>>>>>>>>>>>>>>/gd/
>>
>>58493672
by using hard work, dedication and meme magic
>>
pacman -S cowsay

cowsay 'nigger'
>>
File: 1484126777546.gif (1MB, 720x720px) Image search: [Google]
1484126777546.gif
1MB, 720x720px
>>58493672
>>
It's an autism thing
>>
you don't "make" meme magic it just flows through the internet
>>
File: image.png (94KB, 1920x886px) Image search: [Google]
image.png
94KB, 1920x886px
>>58493672
here's a quick example

from 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
>>
File: pepe.gif (914KB, 507x507px) Image search: [Google]
pepe.gif
914KB, 507x507px
>>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
>>
File: GIF.gif (3MB, 595x360px) Image search: [Google]
GIF.gif
3MB, 595x360px
>>58493672
:^]
>>
File: asciicia.png (135KB, 1612x2099px) Image search: [Google]
asciicia.png
135KB, 1612x2099px
>>58495186
this is fun
>>
dumb frogposter
>>
File: rare.gif (3MB, 500x280px) Image search: [Google]
rare.gif
3MB, 500x280px
>>58496845
>>
>>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 support
from 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()
>>
File: mhlaughingASCII.gif (4MB, 704x704px) Image search: [Google]
mhlaughingASCII.gif
4MB, 704x704px
>>58495825
noice
Thread posts: 28
Thread images: 9


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.