Hello Ingo,

I'm not quite sure I understand exactly what you're trying to do, so I'll
spell out a few options.

First, it is fairly easy to load images using Prima, then to use Prima's
Drawable API to draw lines (see the line(), lines(), or polyline()
functions, or the ), place text, and overlay other images. For the latter,
see text_out() for the most basic, draw_text() for slightly fancier,
text_wrap() for fancier yet with wrapping, and finally the various shaped
text functions. You can put one image atop another using put_image(),
put_image_indirect(), or stretch_image(). Note: I am not sure how well
Prima handles overlaying images with transparent pixels. I had a
back-and-forth a few years ago urging Dmitry to have an image format that
included per-pixel alpha data (32-bit would be sufficient), but I don't
know if he ever implemented that. I've been out of PDL/Prima stuff for a
few years and I'm still getting up to speed with everything Dmitry's done
with Prima over that time.

Second, perhaps you want to put images onto a PDL::Graphics::Prima plot? In
that case note that the plots are drawn in asciibetical order by dataset
name. Datasets that you want drawn above others should have a name (or
prefix) that sorts later. So "a_map" and "b_lines" would draw the lines
after the map.

Third, if you're "plotting" an image using PDL::Graphics::Prima, you can
get per-pixel transparency by setting transparent pixels to BAD---bad
values are simply skipped by the "matrix" drawing datasets. I've meant to
make it possible to set a color for bad values and haven't gotten there
yet, l but for now you can use it for transparency.

I hope that helps. If not, if you could give me a few more details on what
exactly you're trying to accomplish, I can give more specific ideas---or
work on adding features to PDL::Graphics::Prima if needed.

David

On Tue, Feb 22, 2022 at 6:10 AM Ingo Schmid <[email protected]> wrote:

> Hi,
>
> I was looking for a way to overlay images or an image with annotations
> like e.g. lines or text. I can add them as datasets to the same plot but
> the topmost always wins and the rest is hidden below.
>
> The only workaround I have found is editing the image itself, but that is
> messing with data flow.
>
> Best wishes Ingo
> _______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general
>


-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to