Skip to content
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

[Patch Request] Sixel support #7

Closed
smhmd opened this issue Sep 10, 2020 · 6 comments
Closed

[Patch Request] Sixel support #7

smhmd opened this issue Sep 10, 2020 · 6 comments

Comments

@smhmd
Copy link

smhmd commented Sep 10, 2020

Referencing hackerb9/lsix#32.

Base patch: https://gist.github.com/saitoha/70e0fdf22e3e8f63ce937c7f7da71809

Forks of patch in action:

@bakkeby
Copy link
Owner

bakkeby commented Mar 10, 2021

Ah right, I remember seeing an email about this a long time ago, sorry for the profound delay.

It is a quite complicated thing to patch, but who's not up for a challenge?

For reference for anyone trying to go through this the first thing we'll want to do is to revert the following commit that removes the sixel stub code from st (because the other diffs depend on it).
https://git.suckless.org/st/commit/f74a9df6e1fc88eebe6d673d888b61fd83cf6fc4.html

Between the base patch and Charles Daniels' st I think I have managed to work out what changes are needed to st to make this work with v0.8.4.

It moves quite a bit of code from x.c to st.h, so I'll need some cross-patch testing to make sure this behaves as one would expect. At the very least I was able to get this to work with the alpha patch.

I'll be adding these changes on a branch called sixel for now until I have some confidence that it doesn't break too much.

bakkeby added a commit that referenced this issue Mar 10, 2021
@bakkeby
Copy link
Owner

bakkeby commented Mar 10, 2021

Remember to uncomment the line in the Makefile when enabling SIXEL_PATCH in patches.h.

st-flexipatch/Makefile

Lines 11 to 12 in 245c409

# Uncomment this for the SIXEL patch / SIXEL_PATCH
#SIXEL_C = sixel.c sixel_hls.c

@bakkeby
Copy link
Owner

bakkeby commented Mar 10, 2021

To test run:

$ gnuplot

        G N U P L O T
        Version 5.4 patchlevel 1    last modified 2020-12-01

        Copyright (C) 1986-1993, 1998, 2004, 2007-2020
        Thomas Williams, Colin Kelley and many others

        gnuplot home:     http://www.gnuplot.info
        faq, bugs, etc:   type "help FAQ"
        immediate help:   type "help"  (plot window: hit 'h')

Terminal type is now 'qt'
gnuplot> set terminal sixel

Terminal type is now 'sixelgd'
Options are 'nocrop enhanced size 640,480 font "arial,12.0" '
gnuplot> test

@bakkeby
Copy link
Owner

bakkeby commented Mar 10, 2021

Interestingly the drawn sixel image is only visible against a dark background when combined with the alpha patch.
image

@bakkeby
Copy link
Owner

bakkeby commented Mar 10, 2021

Maybe that has something to do with that the sixel graphics are RBG and not RGBA.

@bakkeby
Copy link
Owner

bakkeby commented Mar 25, 2021

The sixel support in itself is fine so I merged these changes and I raised #13 regarding the above transparency issue. I also added a note about this issue in the patches.def.h file.

I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants