Package: graphicsmagick
Version: 1.4+really1.3.38-1
Severity: wishlist
Control: found -1 1.4+really1.3.36+hg16481-2
Control: found -1 1.4+really1.3.35-1~deb10u2

        [Please do not Cc: me, for I’m “on the list,” so to say, and
        I try to reserve my inbox for private communication only.
        I’d have set up Mail-Followup-To:, but there doesn’t seem to
        be a way to make it point to the report being filed.]

        It is currently possible to use $ gm convert command to show
        images by writing them directly into Linux framebuffer, provided
        that the /dev/fb0 device file permissions are set appropriately.

        For instance, on my system, the command could be:

$ gm convert -resize 1280x1024 -gravity center -extent 1280x1024 \
      -depth 8 -recolor "0 0 1 0, 0 1 0 0, 1 0 0 0, 0 0 0 1" \
      IMAGEFILE\[0] rgba:/dev/fb0 

        Similarly, it’s possible to take screenshots, though the
        only way to do so that I was able to figure out requires
        a simple byte order conversion helper, like:

$ (perl -e 'use common::sense; binmode (STDIN); binmode (STDOUT);
            local $/ = \(4 * 1280); while (<STDIN>) {
                s/(.)(.)(.)./$3$2$1\377/g; print ($_); }' \
       < /dev/fb0 \
       | gm convert -size 1280x1024 -depth 8 rgba:- SCREENSHOT.png) 

        The obvious inconvenience here is that the framebuffer data
        format (-size, -depth, but in general also the layout and
        such things as the use of indexed color instead of RGB(A))
        vary from system to system, depending on the hardware and
        its boot- (e. g., I use video=VGA-1:1280x1024-24 on my system)
        and run-time (as could be set with fbset(1), at least on
        some arm64 machines) configuration.

        I therefore suggest that a new ‘Linux framebuffer’ image
        format is implemented in GraphicsMagick that would use the
        FBIOGET_FSCREENINFO ioctl [1] to figure out the framebuffer
        resolution and format before reading (writing) image data
        from (to) it; like:

$ gm convert imagefile linuxfb:/dev/fb0 
$ gm convert linuxfb:/dev/fb0 screenshot.png 
$ 

[1] http://kernel.org/doc/html/latest/fb/api.html

        Better still if it’d be possible to select a portion of
        framebuffer for reading (without reading the whole framebuffer
        first), or to put the image into a given position on screen
        when writing.  While this won’t turn gm(1) into a fully-featured
        framebuffer image viewer, for what we have fbi(1) already,
        arguably it would be rather a convenient feature to use from
        scripts.

-- 
FSF associate member #7257  http://am-1.org/~ivan/

Reply via email to