# GNUplot -- how to improve image definition?

Gold Member
Hi,

I am used to plot data with the GNUplot software. This time I need to add an image to my plot. I did with the following line
Code:
'my_image.png' binary filetype=png center=(3.25,-9.1) dx=0.007 dy=0.0125 w rgbimage notitle
but the final resolution of the picture is pretty bad compared to the original. Do you have any suggestions on how to improve it?

Thanks

robphy
Homework Helper
Gold Member
It might help to show your resulting document.

Since gnuplot output is generally vector graphics and png (like jpg) is raster graphics, it may just be that you need a higher resolution png…or else use a vector graphic version of your png image.

dRic2 and berkeman
Gold Member
Hi, these are the two pictures. The resolution of the original isn't that good, but it gets significantly worse in the plot

#### Attachments

• in_graph.png
7.2 KB · Views: 16
• original.png
19.2 KB · Views: 18
robphy
Homework Helper
Gold Member

What is the final format of the output?

There are certainly artifacts when a raster image is rendered in a different resolution that the original.
Can your gnuplot be rendered in a higher-resolution png to match the original png?

It probably would be better to get a higher resolution original png.
If the original isn't available, one could try a tool like ImageMagick or Gimp to upscale it.

Ideally, you want a vector graphic of the image rendered in your original png.

Alternatively, you could try to manipulate the parts in Inkscape.

Gold Member
Ideally, you want a vector graphic of the image rendered in your original png.
Like a PDF file? Don't think I can do this...

one could try a tool like ImageMagick or Gimp to upscale it.
Why should I upscale it ?

Btw, thanks for all the suggestions. It seems that the best solution is to try to recreate the .png image with a better resolution. I'll try but I'm not sure that the program which I am using is capable of such things

robphy
Homework Helper
Gold Member
Like a PDF file? Don't think I can do this...

Why should I upscale it ?

Btw, thanks for all the suggestions. It seems that the best solution is to try to recreate the .png image with a better resolution. I'll try but I'm not sure that the program which I am using is capable of such things
Improving the format of the original to a vector-based format is best.
If not, then improving the resolution is the next best approach.

Gnuplot may have only one method of resampling raster images.
Something like Inkscape or other image manipulation can maybe accentuate features
that would improve the rendering on Gnuplot.

upscaling might help decrease the artifacts, especially if the upscaling can be done intelligently (say using AI, which may be able intelligently fill in the gaps... e.g. recognize a line and not just magnify the pixelated line.)
I took your original and fed it https://icons8.com/upscaler (which I just found while thinking about your question).

Here is their upscaled version 3000x2796 (attached)
[actually, no it didn't properly attach... it should be 2.2MB file with resolution 3000x2796 .. see below for an enlarged section]
It may not help that much.

One could seek other methods: like "vectorizing" with potrace

original:

upscaled [but PF downscaled it] in the attachment.

Here is a zoom in of a section:

#### Attachments

• original-webp-upscaled.png
66.2 KB · Views: 17
Last edited:
dRic2
Gold Member
Thank you very very much. I'll see what I can do!