|
From: Ethan A M. <me...@uw...> - 2020-04-09 19:24:30
|
On Thursday, 9 April 2020 11:58:52 PDT Dima Kogan wrote:
> Hi.
>
> Can somebody chime in on how hard/trivial a new feature would be?
>
> A common use case for me is to mark-up images. So gnuplot would plot an
> image, and render stuff on top of it. Something like this:
>
> plot "image.jpg" binary filetype=auto flipy with rgbimage, ...
>
> This works, but it is always really slow, and if I'm on a machine that's
> not ridiculously overpowered, it runs out of memory.
>
> My images are several 1000 pixels per side. So big, but not giant. I
> THINK gnuplot is loading each pixel in the image into a separate point
> to be plotted, which makes sense given how flexible this is. But 99% of
> the time for ME, I'm just plotting the image exactly as it is, with
> maybe some independent scaling in x and y. Would it be massively
> effortful to detect that the user is trying to do the simple thing, and
> to run a different code path that treats the image as an image, and is
> thus fast?
>
> Implementation suggestions? Would we want another terminal command for
> this?
Already there in 5.4 (please test release candidate!)
See
http://gnuplot.sourceforge.net/demo_5.4/pixmap.html
But I have not benchmarked it or tried to establish what the limits might be
on a memory-limited machine.
gnuplot> help pixmap
Syntax:
set pixmap <index> "filename" at <position>
{width <w> | height <h> | size <w> <h>}
{front|behind} {center}
show pixmaps
unset pixmaps
The `set pixmap` command is similar to `set object` in that it defines an
object that will appear on subsequent plots. The rectangular array of
red/green/blue/alpha values making up the pixmap are read from a png, jpeg,
or gif file. The position and extent occupied by the pixmap in the gnuplot
output may be specified in any coordinate system (see `coordinates`).
The coordinates given by `at <position>` refer to the lower left
corner of the pixmap unless keyword `center` is present.
[rest of documentation snipped]
Ethan
|