-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a library instead of only a cli application #4
Comments
You can import the underlying library: Also does anyone have any ideas on how to make this work nicely with termbox? Currently I am working around it so termbox's internal buffer doesn't know about the image printed, but I am thinking of forking it and adding some kind of termbox renderer (doubt it will be possible tho). |
@guitmz, @eugene-eeo is right. @eugene-eeo Sorry. |
@eliukblau ah right, I always forget about true colour. Do you think I'll have a better chance with the dithering with characters mode? It looks like it takes up 1 "cell" per ANSIPixel. AFAIK tcell supports true colour, I'll just need to port my UI loop away from termbox. |
@eugene-eeo Oh, maybe you can manually translate any Someone was make a similar solution here. But, in this case, it uses the |
@eugene-eeo @eliukblau yeah thanks, thats what I ended up doing too (importing |
@eugene-eeo Yeah, Dithering Mode is more simpler than Classic Mode. But classic mode is not so complex either. Classic mode simply represents any terminal char as two rows of real pixels of the image with two rows of ANSIPixels (upper pixel and lower pixel). Dithering mode does the same, but uses a trick: because brightness calculation, it needs that each terminal char takes data from 8x4 pixel segments of the image. As example, here is the calculation to get correct image scaling in order to achieve this (taken from CLI code). Classic Mode takes a real upper pixel and real lower pixel, and represents this as 1 cell on terminal (formed of 2 Dithering Mode takes 8x4 pixel segments, and represents this as 1 cell on terminal (formed of 1 Sorry for the bad english. |
@eliukblau ah right, thanks! I'll have a go at it. Thanks for the quick response! @guitmz oh right, I didn't want to use any wrappers around termbox because I wanted to write my own (it's more of a learning thing than anything). I'll try it with |
How does this idea sound to you? I came across your project and really wanted to use it in one of my hobby projects. In the current state, I had to copy and paste a bunch of your code but making it a library would be very much nicer.
The text was updated successfully, but these errors were encountered: