GNUplot -- how to improve image definition?

In summary, GNUplot can improve image definition by adjusting the resolution and using anti-aliasing techniques. Increasing the resolution will result in a higher quality image with more detail, while anti-aliasing can smooth out jagged edges and improve overall visual appearance. Additionally, using different plot styles and color palettes can enhance the clarity and contrast of the image. Finally, optimizing the output format, such as using vector graphics instead of raster images, can also contribute to better image definition in GNUplot.
  • #1
dRic2
Gold Member
890
225
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
 
Physics news on Phys.org
  • #2
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.
 
  • Informative
Likes dRic2 and berkeman
  • #3
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
    in_graph.png
    4.7 KB · Views: 170
  • original.png
    original.png
    14.9 KB · Views: 201
  • #4
possibly helpful: http://gnuplot.sourceforge.net/demo_4.2/image.html

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.
 
  • #5
robphy said:
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...

robphy said:
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
 
  • #6
dRic2 said:
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.

Without access to the original,
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]
from your original 484x451.
It may not help that much.

One could seek other methods: like "vectorizing" with potrace
https://www.google.com/search?q=potrace+png+to+svgoriginal:
original-webp.png

upscaled [but PF downscaled it] in the attachment.

Here is a zoom in of a section:
1632062685054.png
 

Attachments

  • original-webp-upscaled.png
    original-webp-upscaled.png
    46.1 KB · Views: 181
Last edited:
  • Informative
Likes dRic2
  • #7
Thank you very very much. I'll see what I can do!
 

FAQ: GNUplot -- how to improve image definition?

How can I increase the resolution of my GNUplot image?

To improve the image definition in GNUplot, you can increase the resolution by using the set term command with the pngcairo or pdfcairo terminal options. These options allow for higher quality output compared to the default png or postscript options.

What is the best file format to use for high definition GNUplot images?

The best file format for high definition GNUplot images is highly dependent on your specific needs. If you need a lossless format, pdf or eps would be the best options. For web-based images, png or svg would be better choices. Experiment with different formats to find the one that suits your needs best.

Can I adjust the line thickness in a GNUplot image?

Yes, you can adjust the line thickness in a GNUplot image by using the set linetype command. This allows you to change the thickness, style, and color of the lines in your plot.

How can I improve the clarity of my GNUplot labels and axes?

To improve the clarity of your GNUplot labels and axes, you can use the set border and set tics commands to adjust the appearance of the axes. Additionally, you can use the set label command to create custom labels for your plot.

Is there a way to increase the font size in a GNUplot image?

Yes, you can increase the font size in a GNUplot image by using the set label and set title commands to change the size and style of the text in your plot. You can also use the set key command to adjust the size of the legend in your plot.

Similar threads

Back
Top