Steps to reproduce:
1) set background with e.g. feh
2) use "tiv -ajc --reset <cat image>" in a transparent terminal
3) capture the screen (e.g. with gimp)
To tweak the image, open it as a layer in gimp, then capture the screen with only the background showing. Import the captured background image as a background layer in gimp. Make sure transparency is enabled and then you can erase ascii artefacts from the top layer.
]]>tiv -r 0.6 -a -j -c --reset <path to image>
Thank you, that's exactly what I meant. Apology for my confusing english, it isn't my native language. It would be nice if you can upload your orginal "cat-picture" and your background-picture for me. I want to generate an image with the right resolution for me.
]]>skanky wrote:Xyne wrote:@skanky
doneMight reduce your support requests slightly.
Meh, I think i can manage the 3 people who use it about once a year.
Wait 'til LifeHacker get hold of it...
]]>Xyne wrote:@skanky
doneMight reduce your support requests slightly.
Meh, I think i can manage the 3 people who use it about once a year.
]]>@skanky
done
Might reduce your support requests slightly.
]]>edit: can you post your tiv-code for this? How did you generate this picture, with a non-ASCII-background?
By "tiv-code", do you mean the command-line parameters? They should be
tiv -r 0.6 -a -j -c --reset <path to image>
If you meant the source code, you can find it on the project page that I linked above.
I have a transparent terminal so what you see in the background is the desktop background. I ended up uploading some more images after that post. You can find them here.
]]>That's pretty awesome! I will use it as desktop-background!
edit: can you post your tiv-code for this? How did you generate this picture, with a non-ASCII-background?
]]>Replace aa with caca if you want color, though (and assuming you have libcaca installed), and the -monitorpixelaspect option becomes optional.
]]>mplayer tv:// -vo aa -monitorpixelaspect 0.5
#!/usr/bin/python
#encoding: utf-8
""" Konvertor obrázků na textový soubor nebo obrázek z textu
"""
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
print("You need PIL module instaled.")
raise SystemExit
DITHER = {'4col' : '@#Hh',
'8col' : '@@##HHhh',
'16col' : '####xxx===---...',
'32col' : '@@@@####8888cccc****----.... ',
'192col': '@@@@@@@@@########MMMMBBBBHHHHHAAAAA&&&&GGGhhhh999333XXXX22222555SSSSiiiiisssssrrrrrrr;;;;;;;;;::::::::,,,,,,,,......... '
}
COLORS = []
TEXTIMAGE = []
class Pic2txt(object):
def __init__(self, filename, fontsize, chars, dither):
self.filename = filename
self.fontsize = fontsize
self.nrchars = chars
self.dither = dither
self.font = ImageFont.truetype('Terminus.ttf', self.fontsize)
self.__conv2text()
self.__text2pic()
def __open_picture(self):
''' nahraje zvoleny obrázek '''
image = Image.open(self.filename).convert('L')
'''
ted si muzu vybrat nejakou konverzi do sedych barev.
muzu konvertovat tak ze nastavim konverzi na 'L'
nebo pouzit nektery z RGB kanalu
'''
return image
def __conv2text(self):
''' konvertuje obrazek na text '''
pic = self.__open_picture()
width, height = pic.size
image = pic.load()
skip = int(width / self.nrchars)
module = '192col'
for y in xrange(0, height, skip):
col = []
txt = []
for x in xrange(0, width, skip):
value = int(image[x, y])
col.append(value)
txt.append(DITHER[module][value / (256 / len(DITHER[module]))])
TEXTIMAGE.append(txt)
COLORS.append(col)
def __text2pic(self, normal=False, inverse=False):
''' konvertuje textpic na png obrazek '''
ifont = ImageFont.truetype('Terminus.ttf', self.fontsize)
if inverse:
color = 'black'
else:
color = 'white'
image = Image.new('L', (len(TEXTIMAGE[0]*self.fontsize), len(TEXTIMAGE)*self.fontsize), color)
draw = ImageDraw.Draw(image)
for radka, line in enumerate(TEXTIMAGE):
for sloupec, char in enumerate(''.join(line)):
color = COLORS[radka][sloupec]
if inverse:
color = 255 - color
if normal:
color = 'black'
draw.text((sloupec*self.fontsize, radka*self.fontsize), char, font=ifont, fill=color)
image.save('pokus192col.png')
if __name__ == '__main__':
app = Pic2txt('jolie.jpg', 6, 200, 4)