-
Notifications
You must be signed in to change notification settings - Fork 107
-
I had someone provide me with an example of ANSI escape code sequences that create, from scratch, 4 new characters (adding up to 2 unicode chracters): A right-facing trumpet, and a left-facing trumpet.
The 5th character ("1111, HHHH, zzzz, ????") is just me messing around trying to figure out the sixel format.
echo %ESCAPE%P0;8;1;10;0;2;20;0{ @???~}{wo_?/[MFJp@@@@@/GCA@??????/??????????;?_ow{}~???/@@@@@pJFM[/??????@ACG/??????????;??????????/??_ogKYr}{/?_ow\\NVb`O/@B@???????;??????????/{}rYKgo_??/O`bVN\\wo_?/???????@B@;1111111111/HHHHHHHHHH/zzzzzzzzzz/??????????%ESCAPE%
So you can see: 2 trumpets, and a meaningless noise character (between the question marks) that i created with "1111/HHHH/zzzz/????"
I would like to create more custom-font sixel characters. Particularly, I'm looking to modify the devil emoji (to be blue, have longer horns).
Is there a way I can convert the devil emoji (or, a picture of it) directly into the type of sixel representation in the sequence above? That would be a great baseline, then I could mess around and maybe get what I want.
And can this be done with per-pixel color?
Because I noticed with the above trumpets, I could color them using ANSI code, to look like this:
image
But ultimately, I'd like to be able to be more artistic than monochrome custom characters.
I would absolutely love an editor for this.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
Hi! I'm not sure Chafa can help with this directly, but it can help if you start with a PNG or other image screenshot of the emoji you'd like to convert to sixels.
Then you can do:
chafa --polite on -f sixels --exact-size on image.png > image.sixAfter which you can cat image.six. This will result in an image with up to 255 colors (plus transparency). You may want to edit out any newlines near the end-of-file with a text editor.
It's hard to make sixels behave like emojis, since the former have a fixed pixel size, while emojis are provided by the font, whose size may vary. Depending on how you want this to work/look it may be a better approach to edit the font (e.g. by adding new glyphs to one of the Private Use Areas).
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you, and it's true what you say, but I don't know how to do the private use area thing 😅 I'd love to know how to create my own [internal for use on my own PC] emoji like this tho. I already created a pentagram one today. But yes, it's absolutely a 20x20 (two 10x20 chars) with weird lack of antialiasing where the characters join.
Beta Was this translation helpful? Give feedback.
All reactions
-
Unfortunately, custom connective characters (making a bigger image by placing the characters next to each other) will often have visible "seams" between them on modern terminals. They have internal workarounds for the official block drawing Unicode characters making them viable, but this doesn't apply to custom characters.
With sixels you should be able to create symbols as wide as you'd like, though - if you find any artifacts or other obstacles to using Chafa this way, I'd love to hear about it. Feel free to open issues!
Beta Was this translation helpful? Give feedback.