GNU bug report logs -
#44172
28.0.50; Exporting image data
Previous Next
Full log
Message #14 received at 44172 <at> debbugs.gnu.org (full text, mbox):
On Fri, Oct 23, 2020 at 01:18:40PM +0200, Lars Ingebrigtsen wrote:
>
> 1) Making image data available to Emacs Lisp.
>
> This is something that I've often wanted for other reasons -- I want to
> know how an SVG was rendered, for instance (especially when doing
> font-based stuff), and there's no way to actually tell.
>
> So I think Emacs should have a function like
>
> (export-image-data IMAGE &rest SPECS)
>
> that will just take the image cache data for IMAGE (or the frame
> specified by SPECS, if multi-frame) and dump the RGB(A) data into the
> current buffer (which should be unibyte, for efficiency), and return
> a plist of width/height/bytes-per-pixel/rgb(a) ordering. This is
> basically the PPM binary format, but without the heading.
>
> This allows us to do easy transforms like cropping and rotating from
> Lisp, too.
Are you talking about using an image spec that we use to display
images, which can already include rotation and resizing?
That would be difficult because the stored image data doesn't have
those transformations applied, unless you're using imagemagick. We'd
have to draw it to a buffer (either on-screen or off) and then read
back that data.
--
Alan Third
This bug report was last modified 3 years and 222 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.