Besides using the rxvt-unicode-sixel fork, it might be possible to implement sixel by writing a perl extension. Documentation for that is in the urxvtperl(3) manpage. I don't know much about sixel but I imagine it's a matter of:
intercepting the sixel escape sequences, interpreting them and not letting them pass through to the main escape sequence interpreter. You can replace the sequence with newline characters to displace the correct number of lines to fit the image's height, maybe scaled to fit the width.
drawing the image. You can get the correct window id via the API urxvt provides to extensions, and use regular xlib or xcb functions to draw the image if need be.
watch out for events like scrolling to redraw the image as needed.
I see many possibilities here that could be configurable, though I don't know if there are standards on sixel implementations. For example, what happens to images when resizing a terminal? Is it clipped? Is it scaled? only on creation or on every resize as well? what happens when the cursor is then moved over the image and one writes enough for text to wrap? what happens to the image and wrapped text when you resize then? etc.
I think the ideal would be to initially draw it at the scale of what's smaller between the terminal width and the image size, and set that as the maximum size of the image. Rescale the image on terminal resize, while respecting the maximum size set. With respect to text drawn over it, it might get a little complicated to keep that text over the image on redrawing the image...
Sorry, seems I got a little excited and got out of scope for your answer. Kind of wish I had the time to work on this.
EDIT: To answer to skepticism in the comments on the ability to work with pixels from a urxvt perl extension, here is a proof of concept. It sets a pixel the color white on coordinate (10, 10) from the top-left:
use strict;
use warnings;
use X11::Protocol;
my $X = X11::Protocol->new;
sub on_refresh_end {
my $term = shift(@_);
my $gc = $X->new_rsrc;
$X->CreateGC($gc, $term->vt,
foreground => $X->white_pixel);
$X->PolyPoint($term->vt, $gc, 0, (10,10));
$X->flush;
}
To install this extension, put it in ~/.urxvt/ext/sixel-proof-of-concept
, add it to ~/.Xresources (or ~/.Xdefaults if you use that) by adding the line URxvt.perl-ext-common: sixel-proof-of-concept
, load that by doing xrdb ~/.Xresources
, and make sure you have the X11::Protocol
perl module installed.