Comments (8)
Just tested 256 color support. Probably not too involved to add.
To test, please check out color-256-testing
branch:
https://github.com/hzeller/timg/tree/color-256-testing
from timg.
Not quite sure what your request is: would you like that upscaled images (e.g. using -U
) are more 'sharp` ? Maybe we should introduce an 'upscale, but only in integer multiples' variant, so that in a scale of 2, a pixel either fits one half block, or 4 half blocks (= 2 spaces with background color set).
The -U
is already there to not upscale (and 'unsharpify :)') images if they are very small (such as icons). But having an integer option to scale it as multiple of original pixels will then always produce a sharp output.
(For pixelation: Internally, timg already does optimize the case of two vertical same pixels being replaced by one space as background color. If the image was integer-scaled with factor two in each direction, we automatically get spaces with background color output)
from timg.
I've added now added an optional parameter to --upscale
: 'i' for integer upscale.
So a small picture, like this sunflower without upscaling
timg tiny-sunflower.jpg
... and that looks like this with --upscale
(or -U
) option (this looks bilinear scaling, so is 'fuzzy):
timg tiny-sunflower.jpg --upscale
... looks like this with integer upscaling --upscale=i
:
timg tiny-sunflower.jpg --upscale=i
Is this roughly what you had in mind ?
from timg.
Wait, I forgot that Terminal.app
doesn't support 24-bit colours. I blindly assumed the following mess to be the fault of my terminal font:
However, Alacritty proved that wasn't the case:
I filed this issue before I remembered \e[35;2;R;G;Bm
gets mangled by Terminal.app
, so... 😅
On that note, is there a way to force \e[35;5;…m
escapes for terminals that don't support 24-bit colour?
from timg.
On that note, is there a way to force \e[35;5;…m escapes for terminals that don't support 24-bit colour?
Not right now. It is the question if it is worthwhile supporting the by now mere handful of ancient terminals that do not support 24 bit color (without decreasing code readability too much or performance) vs. filing bugs with them to actually support it.
I mean, even xterm supports 24 bit color these days. And that is an ancient application from 1984 but still up to the present time.
Please file a bug for 256 color support. Let's see if that is more requested (and potentially considering sending a pull-request).
from timg.
Alright, there is now a --color8
option :)
from timg.
I guess we can close this one ?
from timg.
Jesus. That was quick.
Thanks for the fast response!
from timg.
Related Issues (20)
- carbonyl love?
- Images rendered blurry in fzf preview. HOT 2
- new version not have binary file HOT 7
- No package 'libdeflate' found HOT 2
- ipv4 vs. ipv6 HOT 5
- libsixel is not available on Fedora 38 HOT 2
- Image preview in `lf` HOT 1
- Detected Crash: AddressSanitizer: heap-buffer-overflow HOT 7
- missing size parameter in iterm's protocol HOT 12
- Image viewer with scrolling HOT 3
- Detected memory leaks on timg
- Auto detect for Ghostty doesn't work HOT 8
- Cannot display certain SVG files HOT 6
- can we convert a whole video? HOT 2
- tmux passthrough for other terminals HOT 3
- Cannot read pdf in alpine container HOT 10
- Opensllde Error HOT 5
- Sixel support in foot does not get recongnized correctly HOT 8
- How about implementing [hyperlink support](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) HOT 2
- Displaying long images starting from the top instead of the bottom HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timg.