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 15:13:59 +0600 Message-ID: <87fsh2b548.fsf@disroot.org> References: <87v8pz18wf.fsf@mail.jao.io> 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="11668"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Jose Antonio Ortega Ruiz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 08 12:50:18 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 1oWF6w-0002pV-Oh for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 12:50:18 +0200 Original-Received: from localhost ([::1]:39484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWF6v-0006ls-4L for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 06:50:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWExS-0002Nt-2J for emacs-devel@gnu.org; Thu, 08 Sep 2022 06:40:30 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:56310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWExN-00053Z-6O; Thu, 08 Sep 2022 06:40:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 10E2840144; Thu, 8 Sep 2022 12:40:21 +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 ESMTP id s3suEXAa9WYV; Thu, 8 Sep 2022 12:40:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662633619; bh=cPT8c8MyHUpHX97eS5XkKCjCfA85ETMT3iLhqys2514=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=BXKf3rXLkCQOXwtumBwlBGyCW0EY8n1yLAqrmuthI67eVbIUN2wmNcQYb+CqWLD0p gHiNXj9261+eDeb2TgNiw5EKgijtFcBgCutY+ZYxTAjJr03K1V1iHWIvwgZ+0feWKh 7Pz8FouYauHTSK+0B9F0sd1wBz3/FQyFNnyuTNRXO3UuOECRzfOTiPd0VWmDFaUlH+ JZJ4vcS3NKYLfL7Fi+6ApEpZOaiwCD5dlCxFYP8bwYwBX5XktpNv7E0o9sk95HOOAR ALDOBwEE0ItKwULX/ad7BeS5zReD64trE6IaZGUEvqTq03GFDiPlOc1AeJ8ZsbxK/C vAeTg3kX6fpaA== In-Reply-To: <87v8pz18wf.fsf@mail.jao.io> (Jose Antonio Ortega Ruiz's message of "Wed, 07 Sep 2022 16:50:08 +0100") 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:294923 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jose Antonio Ortega Ruiz writes: > Hi, > > The kitty terminal emulator (which runs under X11 and wayland) offers a > simple protocol for displaying images, fully described at > .=20=20 Many text terminals also happen to show images. But I think Kitty is a video terminal that also happen to show texts. > > In a nutshell, it accepts an escape sequence that make it enter "graphic > mode", followed by either encoded image data or a path to an image file > or a shared memory location to display. Among several other niceties, > the protocol allows drawing to rectangles specified in cell units. As a > simple example, the sequence: > > _Gf=3D100,t=3Df,c=3D50,r=3D100;\ > > would make kitty draw the image in file.png rescaling it to 50 columns > and 100 rows. By default, the current cursor position is used, but it's > also possible to specify pixel offsets and sizes. > > At first sight, it looks as if adding support for this protocol to > emacs's tty terminal (when kitty, or the capability (it seems other > terminals support the same protocol) is detected) shouldn't be too > complex, and with that, perhaps, provide direct support for the > elisp-level image- API for these terminals (so that, for instance, > doc-view or pdf-tools or displaying images in eww buffers would work out > of the box). Am i wrong? IMHO, showing images by converting to text would be a better choice. It would also allow to show image on Linux console. Because the idea you propose would probably make the Emacs C source more complex. > > On a personal note, if that were possible it would put emacs on a kitty > terminal on the same league as the full graphical version for my needs, > with the added benefit of dramatically reduced RAM footprint, faster > display and, last but not least, a truly great alternative to pgtk in > wayland. So, if the implementation is feasible, i'd be willing to help > if needed. You can use Xwayland to run X applications on Wayland. But Emacs has a pgtk port, so you shouldn't need that. Is there any X server for sixel terminals (like Kitty)? If there is any then you can that to run graphical Emacs in terminal. And about the RAM footprint, every new feature usually increases RAM footprint; so implementing this would also probably increase Emacs's memory footprint. > > Thanks, > jao =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----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMZslgACgkQVTX89U2I YWsHcRAAwExUVa8O6yyxOE2SZEyIfbNsMsSaIcXir06g0C0Lp692sKwoVu0mF9ON +oSCROYi7i2Augu0eHYzV9ZodlVN7FC7+rE7b7LOPfJ85lWYz0VqyChd46nMpkll lQpwfmWt19vX1fGZ+t3opoJVhxVJtquJTbxEiuzblrS4snj5MnsZzOj+yfEdKQsZ PimiMZnYw/6Sko60KdyGPJdHv8mUdQZqSHtL3czz/qW3LNNnaGQ+UyGV6FLXbJJh oAbKKX3g+R54HAyZouCl9y37dCP2IU+15lzMl3rWIeN+e4L8UcQtTv9EnJReki2O T5Wx2phezrWBWiLIPJXEsei4QL3WCqL9vgibkjTDDYoOvOX86lRyQ8L0Io1J+MQC XgADo+cYjsC9QYVIlc4M6GKqXW73j8sBgyEENxNGfV+jW2veETfzyVn78khlHwUz KxDqzQX+YWVA3KkyLuGSRxvKzlyjjUdOrGHdWsTtsC89x8Hum5iSW73+q8xC0J0d GdWxkYKDiksnShYHdzeeQRviYhzZ93hd3c37SPJijwH3a4dkGQuwiZMl29p6SqwC mCL7YKXAY/IlHHFVuDElWmnAEGXubQJcHItdfhz7O4diuHSByiKtjnhQwP7iXvtv a+8fsJcvAo/nW4ClaQ+UDwUcyBuELFYp1A4UKFD6VhGPaN2C6iY= =tgtH -----END PGP SIGNATURE----- --=-=-=--