-
Notifications
You must be signed in to change notification settings - Fork 82
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
Feature request: Add palette mapping for VT240 #169
Comments
The other problem will be that libsixel doesn't take into account the limited range of the VT240 palette, so it may calculate something like RGB(12,83,41) as being the best palette value to use, but what the VT240 actually sees is RGB(0,100,33). I'm not sure the results would be that much better if it did account for those limits, but it's possible there's room for improvement there. Is that what you were suggesting regarding the VT240 map file? I should also mention that this project is not actually active anymore - the maintainer hasn't been seen for several years now. Some libsixel users have created a fork at libsixel/libsixel which has a little more activity, so that may be the best place to follow up if you're hoping for new features to be developed. |
Hey @j4james thanks for the info. I did try some B&W images and am still getting no change of the default palette. So, something's a bit off. Maybe RGB(12,83,41) would be ignored? I'm not really sure. That is indeed what I meant by the map file -- maybe it needs to output exactly the colours in the PDF, so if I can force it to only use those colours, maybe it'd work better. I could use a little hand-holding... I'm quite busy these days. If I can't manage it with a map file, I'll go hit up the fork. |
OK, that is strange. Can you perhaps try something like this with the B&W test image:
Then open up the
The
The first number in each entry is just the color ID, the second value (the My test image wasn't pure B&W, so the RGB components have a bit of variation to them, but you can clearly see they're not just red/green/blue. Otherwise you'd expect something like this:
So can you check the sixel that is generated for one of your B&W test cases and see whether it at least looks right. Then we'll know if there's a problem with img2sixel, or it's the VT240 that is ignoring the palette.
If that's the case, you can try editing the palette in the generated file to something that more closely matches the VT240 color range, e.g. for B&W it could be something like this:
Or if you think it might require the colors to be HLS, the second value in the palette definitions should be changed to
The image won't necessarily look correct if the order of the palette isn't right, but that should at least show whether it is making any difference at all, or your VT240 is simply not accepting palette changes. |
Currently, conversion for display of images on a real VT240 using
-p 4
always displays the same 4 colours: red, green, blue, black. However, the sixel support on a VT240 actually can display 4 colours chosen from a palette of 64 colours. The fixed palette is documented on page 162 of this PDF:http://bitsavers.org/pdf/dec/terminal/vt240/EK-VT240-RM-002_VT240_Programmer_Reference_Manual_Oct84.pdf
Could output matching these colours be achieved with a mapfile? And, if so, can a standard VT240 mapfile be added to the distribution?
Love your library. Thanks for your hard work.
The text was updated successfully, but these errors were encountered: