From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: Re: Implementing image support for kitty terminal Date: Thu, 08 Sep 2022 16:59:53 +0600 Message-ID: <875yhyb07q.fsf@disroot.org> References: <87v8pz18wf.fsf@mail.jao.io> <83o7vrgimc.fsf@gnu.org> <87wnafdnee.fsf@logand.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36498"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Jose Antonio Ortega Ruiz , emacs-devel@gnu.org To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 08 14:12:06 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWGO2-00099R-I4 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 14:12:02 +0200 Original-Received: from localhost ([::1]:48180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWGO1-00060R-KW for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 08:12:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGMJ-0003gb-7P for emacs-devel@gnu.org; Thu, 08 Sep 2022 08:10:17 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:57876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGMF-00049V-A8; Thu, 08 Sep 2022 08:10:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3EF9349FB8; Thu, 8 Sep 2022 14:10:08 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id OMKrO5JKrN3J; Thu, 8 Sep 2022 14:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662638879; bh=GDFoHJ8RKIP5fpWvhlhhusGUXBGKeaJwvgXrG54DWU4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ZuFNJcD5U3PBRSpaGKRIsf2DVMy0iMJtEyNp1qT+MTnL0Mb40DCAPVN0O1S/FvsJH v7Di0tTEJScddiegRDO/ocErIjsgz1tmrFeMzodim29bhGvYAlaup0H4h0Ot32vfX5 f5YeEUjdyCoTzj+E7K3JPMxMJBwaUIT/dw2snb5Bq732P8jQ63jurXOiOcXLKD+L+K jU/ukqSHJ7F/IxxNkF4MirnO4/J9v+wuopP0QVYRQc1NqmWp/PQkmo82+HsAVnmKmv EsrPR9euVc775AbPYVmRPTANVizqyFRU7JGNvEYWxJbsip04ZVQ5u9KsNRJG+R2mNp C72lEyMUHk/gQ== In-Reply-To: <87wnafdnee.fsf@logand.com> (Tomas Hlavaty's message of "Wed, 07 Sep 2022 20:56:09 +0200") Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294931 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Tomas Hlavaty writes: > On Wed 07 Sep 2022 at 21:11, Eli Zaretskii wrote: >> In particular, the current model of image display >> in the Emacs display engine is that an image is basically considered a >> single very large character, from the screen layout POV. > > Are you talking about GUI emacs? > Is that not different in tty emacs? > I thought that the tty emacs has no concept of image (so far?). Yes. There is no image in text terminals. > >> I guess >> that's not what you have in mind for the above, so IMO it's important >> to come up with an alternative model that would somehow fit with the >> current display code with only minor changes, if we want this not to >> be too complex. > > For example, the tty based w3m web browser optionally supports images. > It reserves space w*h chars on the tty and then uses external program > to draw the image in the right place. > > I guess tty emacs would also need to reserve a w*h chars rectangle on > the tty and then send the right escape code to fill that gap with the > image. > > First, tty emacs would need to understand images instead of throwing > error. At least their dimensions. Maybe using some library or even in > elisp, for example like this > https://logand.com/sw/emacs-framebuffer/file/emacs-framebuffer.el.html#l2= 86 > I have not figured out, how to actually plug it into upstream emacs, as > this seems to require a lot of changes to C code. > > Second, tty emacs would need to somehow reserve rectangle for the image. > This might be lots of work I guess. > > Third, there would have to be a piece of code which actually draws the > image. In case of kitty terminal, the image path and coordinates would > be sent to the tty using the kitty terminal protocol. In case of Linux > console, the image path and coordinates would be sent to an external > program like w3mimgdisplay. > =2D-=20 Akib Azmain Turja Find me on Mastodon at @akib@hostux.social. This message is signed by me with my GnuPG key. Its fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMZyyoACgkQVTX89U2I YWuYkA//UWaQ5zRPEzYGJg2S4bNv/Rl4+0DDRh/z8BPDmjlGD0hfsWOytpriou45 Caqo2W7gnSEuvhlsRaSTE9SpWQEyDAHi9en7EhxFn+/rNMhLAJxHNDuhQrTlc2UM F5UFb+TVYWFAm4bqSjemyy7x7akzasLgOYEhb/gmQqjmx0ZmJFlh77tu0s5EsrDF 6NWpIV59ljj1wGqxu4IN/FoVAbcWxOxERzY4IuMLTtRDfDEzsaW0YhsZHcFCd/Lu CvuRTZrYoihwI4CBoGk/g0SkoQJsT7W07clk7rk1WO4DVnVXzbtynPXkdN+jwLwX AqEiM0uFb7yV9OClRMl5LVWBPlk2aa5hQBmKtfEEyGGez7/B/E06f9lEGC5zmTey 5ZhJrGCJAOPu+6cK5vKU067bUa6R2n7ZfsCKxt8IZVN18zJMVVrJEcwKCZiUZnBV vD5LaiYA8lUKpEvhALBzZsJAg2LUGmOUgc41S/DxEcSk3nKS8hwpNu8bOes+x0zB OUOU5kRzv40cVNiOprUA3OyuoHFe9otCSlNPaeJDB++/8rX9YaIvxI5a4CF1BirV cortgxvPqhOnkpdqGkSYLwjSIb1Kh0d2OoaKJXhsn4kiQ42aglYEfk1Tx+qw2LAf 7vKJIWrIb3HfImtCunqRxyzfo98wmYtVVNRG31dxf9b71jPq2A4= =wgvk -----END PGP SIGNATURE----- --=-=-=--