<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to patches</title><link href="https://sourceforge.net/p/gnuplot/patches/" rel="alternate"/><link href="https://sourceforge.net/p/gnuplot/patches/feed.atom" rel="self"/><id>https://sourceforge.net/p/gnuplot/patches/</id><updated>2026-04-26T20:49:22.076000Z</updated><subtitle>Recent changes to patches</subtitle><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#b9d0" rel="alternate"/><published>2026-04-26T20:49:22.076000Z</published><updated>2026-04-26T20:49:22.076000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.net7e4d5abc79774a2c7c4e1766ed95389386e9733b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Understood, I will split the patch and hopefully submit them here within the next week.&lt;/p&gt;
&lt;p&gt;Regarding your ideas on how to present this to the user: Currently, the user indeed has to specify both a physical size and a &lt;code&gt;resolution&lt;/code&gt; to trigger the dpi render path. Previously, if the user specified a physical size (instead of pixels), the physical size was just transformed to pixels assuming 72 DPI and everything else stayed the same.&lt;/p&gt;
&lt;p&gt;One more thing that we could integrate into the patch would be allowing to give pixel dimensions and still give a resolution. This could trigger the terminal to activate the DPI render path and convert the pixel resolution to some physical size (i.e., dividing the x- and y-dimensions by the DPI, which would yield the size in inches).&lt;/p&gt;
&lt;p&gt;Another options would be to not give the resolution in DPI but to basically give a global scaling factor, with 1.0 = 72 DPI (no action), 2 = 144 DPI and so on, but I find this less intuitive than the DPI approach.&lt;/p&gt;
&lt;p&gt;There would also be the option of renaming the &lt;code&gt;resolution&lt;/code&gt; parameter to &lt;code&gt;dpi&lt;/code&gt;, which would make it even clearer (in hindsight, I think I would prefer this).&lt;/p&gt;
&lt;p&gt;Let me know what you think is the best approach.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#ba29/4bdc/9b4c/29c5" rel="alternate"/><published>2026-04-26T20:39:39.331000Z</published><updated>2026-04-26T20:39:39.331000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.net211753c3a06334df156114e2dfb984b55dba63ed</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Perfect. I will put some more work into the libgd part and provide two options: One that completely removes the clipping (which would make it symmetric to the cairo terminals) and one that properly clips with a layer based approach (such that clipping is not done any longer on every &lt;code&gt;PNG_Vector&lt;/code&gt; call.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#a9f9/15b3/a08e/a852" rel="alternate"/><published>2026-04-25T06:07:19.483000Z</published><updated>2026-04-25T06:07:19.483000Z</updated><author><name>Ethan Merritt</name><uri>https://sourceforge.net/u/sfeam/</uri></author><id>https://sourceforge.net2cffdb34a3d26e82ab477ae252fa81325c7fe221</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Cairo terminal thoughts&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a) Everything pertaining to cairo (and maybe webp, as it is directly connected)&lt;br/&gt;
b) Everything pertaining to libgd&lt;br/&gt;
c) All the metadata injection.&lt;/p&gt;
&lt;p&gt;Would this work better for you? &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes.  I'd like to see a patch that has just the cairo terminal changes to support the dpi adjustment. I agree it may end up being a rather small patch.  I am dubious that the metadata is worth it unless it can be done via a library call, which I gather cairo does not offer. &lt;/p&gt;
&lt;p&gt;It may be worth discussing how this is best shown to the user.  As I understand it the current patch only kicks in if the user specifies both a physical size and a dpi.  That makes sense for preparing an image to be sent to a specific printer.  It makes less sense for viewing on the screen, where the nominal size and the displayed size are often quite different.  And in my experience you often do not know the true dpi of the eventual output device (journals used to print at something like 3000 dpi; I don't know what they do now).  You only know the desired physical size.   Same for displaying on a screen; you don't know in advance whether your plot will be displayed on a 95 dpi monitor or a Retina device.  Would it make more sense to offer something like "rendering quality" where 1.0 = current behavior and higher values are treated internally as &amp;lt;new dpi=""&amp;gt;/72 or something like that? &amp;lt;/new&amp;gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#ba29/4bdc/9b4c" rel="alternate"/><published>2026-04-25T03:04:57.050000Z</published><updated>2026-04-25T03:04:57.050000Z</updated><author><name>Ethan Merritt</name><uri>https://sourceforge.net/u/sfeam/</uri></author><id>https://sourceforge.netf341159853c1f13805f69a55d6011dcac1ab7c0f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;span&gt;[PATCH 6/8]&lt;/span&gt; Fix libgd clipping and libgd/cairo border rendering&lt;/p&gt;
&lt;p&gt;I have extracted and committed the parts of this patch that add term-&amp;gt;path to the cairo terminals and gd terminals. Thanks.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#a9f9/15b3/a08e" rel="alternate"/><published>2026-04-24T22:53:39.766000Z</published><updated>2026-04-24T22:53:39.766000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.net28b049ea2fda3222c6f7d1a0a6b1614d08db4867</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;I don't get it. When or why would someone use one of the gnuplot raster terminals on a high-DPI monitor rather than a vector-based terminal based on a graphics layer that scales properly - qt, wxt, aqua, or svg?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I agree that vector based output is usually the best choice if the viewer supports it, but there are many cases where vector output is impractical:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MS Office historically had very poor vector support (might have gotten better in the meantime)&lt;/li&gt;
&lt;li&gt;I personally often use scatter plots with thousands of rendered dots. Having a viewer render then several of these plots, for example side-by-side, will quickly lead to problems&lt;/li&gt;
&lt;li&gt;I also have had many situations where I had to review hundreds of plots in quick succession and using vector output for this is impractical because it takes a while to render one plot so quickly switching back and forth between plots to compare output is only possible when the images are already rasterized.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now you will probably say: Why not rasterize then from pdfcairo or svg output? Yes, you could do that, and I was doing so before but it takes additional effort and with this argument you could also say that Gnuplot technically does not even need any raster terminal drivers, as they could all render their output from one good vector driver internally and just convert the rasterized output to the target image format. Indeed, this would probably even make this feature irrelevant, as if Gnuplot worked this way, there would probably already be an option to specify DPI when rendering to a raster output format.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Maybe I'm missing an important use case for this, but I think as currently stated this goal misses the mark. It shouldn't be framed as "how do we make it easier for people to use the PNG terminal at high resolution?". A better goal would be "how do we make it easy for people to choose the right terminal for something that requires high resolution?" &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As stated above, the right terminal for a high-resolution plot, in my mind, is not always a vector terminal. I was recently in need of a hjgh-res rendering of a high-point-count scatter plot for a large Powerpoint poster and I had issues with the vector approach. In this and many other cases it is just simpler to directly render to a raster format with your desired resolution.&lt;/p&gt;
&lt;p&gt;As a last point: I think, if we strip out the meta-data embedding, the code changes actually needed for this feature are not that complex. They mainly touch the scaling of different plot elements where there already is scaling involved due to other reasons.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;eah you might then notice poor resolution, but if that really matters then the embedded image should have been generated differently - maybe SVG or maybe PNG but with scaleable text overlay. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is not only the text that is an issue. The raster terminal drivers were designed to produce text, lines and points at a size and thickness that looked nice on monitors when Gnuplot was conceived (CRT monitors with 72 - 96 DPI). Today, this is not the default any more. Yes, a viewer (e.g. a browser) can upscale a low-res png rendering, but this will result in an interpolated blurry looking image (depending on how much it is upscaled).&lt;br/&gt;
When I use Gnuplot personally with raster terminals, the first thing I usually have to do is to increase all line thicknesses, font sizes and point sizes (as well as the output dimensions) because the defaults are just not working, and with good reason.&lt;/p&gt;
&lt;p&gt;There is also another point here that I already mentioned, but I want to emphasize it here once more: Gnuplot already allows giving sizes in cm or inches, which are then interpreted for a resolution of 72 DPI. So, implicitly, DPI support is already a part of the raster terminals. The argument now is: Why is this  locked to 72 DPI? Would it not be a natural generalization to allow for other DPIs?&lt;/p&gt;
&lt;p&gt;There is also another way to think about DPI support that maybe makes the whole think more palatable: Think of it as a &lt;strong&gt;global scaling factor for the output&lt;/strong&gt; This is something that is currently missing in Gnuplot, although there are several terminal dependent factors like &lt;code&gt;fontscale&lt;/code&gt;, &lt;code&gt;linewidth&lt;/code&gt; or &lt;code&gt;pointscale&lt;/code&gt;, but nothing that just scales all elements synchronously. Do you not think that this would be a very useful feature?&lt;/p&gt;
&lt;p&gt;In fact, as I already mentioned, most other plotting engines explicitly support exporting to raster terminals with a given DPI. Look at MatPlotLib or MatLab with its &lt;code&gt;exportgraphics(f,"barchart.png",Resolution=300)&lt;/code&gt; command, but there are many more.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;t may be worth breaking out any discussion of webp format separately. I wrote the current webp terminal as a quick-fix alternative for making animations, since animated gif has pretty much died out, and constructing animations by post-processing individual PNG or JPEG frames is laborious. Because it was easiest, I based it on the WebPAnimEncoder API. But that API is for a stripped-down toolkit that doesn't provide many features you would want for serious animation. If someone wants to start over and write a webp terminal based on one of the more complete APIs for webp generation, that's great. It would be more work, but then you'd have higher quality output, easy generation of EXIF metadata, and probably more stuff like hooks for audio synchronization. Or maybe write an AVIF terminal instead; I have not looked into that.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rewriting WEBP support to allow for easier EXIF metadata creation, etc. would certainly be a good idea, but I would be careful with pulling too many heavy dependencies to make this possible. I like Gnuplot because in a sea of bloatware, it is small, compact and fast. For now, if you don't like the byte-by-byte creation of the EXIF header that works with WebPAbimEncoder, I would just not embed the resolution. As a matter of fact, not embedding resolution in any of the metadata where it is still missing is definitely an option. I would find it much more important that the base DPI feature is realized.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#d114/fb93/53f9/4001" rel="alternate"/><published>2026-04-24T22:09:59.027000Z</published><updated>2026-04-24T22:09:59.027000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.net6e80d03273adf379c25c83e53c209bd6349842d8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ah, you are probably using a different fallback font that has all the glyphs of &lt;code&gt;armillary.dem&lt;/code&gt;, while my fallback font was missing a glyph.&lt;/p&gt;
&lt;p&gt;The boxed text you requested in your script indeed poses a problem for the current patch. Your suggested alternative approach sounds feasible, I will try to come up with a workaround that involves this strategy.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#a9f9/15b3" rel="alternate"/><published>2026-04-24T21:01:55.232000Z</published><updated>2026-04-24T21:01:55.232000Z</updated><author><name>Ethan Merritt</name><uri>https://sourceforge.net/u/sfeam/</uri></author><id>https://sourceforge.net3f8113f9f73ed245d4514c1c5f71cec90fed9e2f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;Now for the goal and what we are trying to achieve: The main issue is that right now, the raster terminals are not very useful any more if you are working with high-DPI monitors, which is getting more and more common. A plot that looked great previously on monitors that were using resolutions below 100 DPI will not work any more for today's Retina, 4K, etc. displays.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I don't get it.  When or why would someone use one of the gnuplot raster terminals on a high-DPI monitor rather than a vector-based terminal based on a graphics layer that scales properly - qt, wxt, aqua, or svg?  And even in the case of, say, a PNG image displayed on a web page, the browser knows how to scale the image larger.  Yeah you might then notice poor resolution, but if that really matters then the embedded image should have been generated differently - maybe SVG or maybe PNG but with scaleable text overlay.   &lt;/p&gt;
&lt;p&gt;Maybe I'm missing an important use case for this, but I think as currently stated this goal misses the mark.   It shouldn't be framed as "how do we make it easier for people to use the PNG terminal at high resolution?".  A better goal would be "how do we make it easy for people to choose the right terminal for something that requires high resolution?" &lt;/p&gt;
&lt;p&gt;It may be worth breaking out any discussion of webp format separately.  I wrote the current webp terminal as a quick-fix alternative for making animations, since animated gif has pretty much died out, and constructing animations by post-processing individual PNG or JPEG frames is laborious.   Because it was easiest, I based it on the WebPAnimEncoder API.  But that API is for a stripped-down toolkit that doesn't provide many features you would want for serious animation.  If someone wants to start over and write a webp terminal based on one of the more complete APIs for webp generation, that's great.  It would be more work, but then you'd have higher quality output, easy generation of EXIF metadata, and probably more stuff like hooks for audio synchronization.  Or maybe write an AVIF terminal instead;  I have not looked into that.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#d114/fb93/53f9" rel="alternate"/><published>2026-04-24T19:54:07.063000Z</published><updated>2026-04-24T19:54:07.063000Z</updated><author><name>Ethan Merritt</name><uri>https://sourceforge.net/u/sfeam/</uri></author><id>https://sourceforge.net6a947115a13655b8ab64dc5ff43921a2a8b4197d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;code&gt;armillary.dem&lt;/code&gt; works for me without any missing glyphs, so the patch is not relevant.  I.e. the glyph/font support provided by some underlying library (in my case libfontconfig) is also a contributing factor. &lt;code&gt;charset.dem&lt;/code&gt; does indeed show that the patch removes over-large garbage from the output;  note, however, that since the entire point of the demo is to determine what can or can not be printed with the current settings a better solution might be to simply skip the unavailable characters altogether rather than dealing with improperly rendered replacement glyphs. See proposed alternative approach below.&lt;/p&gt;
&lt;p&gt;I figured out that the garbage output I saw before is because my script requests boxed text.  The patched code suppresses the bad glyph rendering but still reports text metrics that are off by a factor of 200. That produces a box around the text drawn as a huge rectangle with the wrong center.  The incorrect centering is true even for unboxed text, so I suspect the patch results in incorrect placement for all right- or center- justified text longer than a single character. &lt;/p&gt;
&lt;p&gt;I definitely think this is a pango bug and that is where it should be reported and hopefully fixed.&lt;/p&gt;
&lt;p&gt;I wonder if a different work-around is possible in gnuplot that would be simpler and possibly more generic.   The current patch uses &lt;code&gt;pango_layout_get_unknown_glyphs_count()&lt;/code&gt; to detect the error case.  If this routine can be used iteratively to drill down and find individual problem characters, then gnuplot can simply delete that character from the output text or replace it with what Unicode calls a ".notdef glyph".  Unfortunately there is no Unicode code point for this symbol.  Some rendering environments use � (U+FFFD REPLACEMENT CHARACTER) instead.  That is what you see in the qt output I attached. Other possibilities are ▯ or ⍰ or a blank space. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#a9f9" rel="alternate"/><published>2026-04-24T11:32:47.685000Z</published><updated>2026-04-24T11:32:47.685000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.net34d495a7e3e3e4d180ceae26a63921b849bf9db1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi &lt;a class="user-mention" href="/u/sfeam/profile/"&gt;@sfeam&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;let me try to make a strong case here for this patch:&lt;/p&gt;
&lt;p&gt;First, I agree that the meta data (resolution) injection introduced for cairo and webp is probably not the cleanest solution, but it seems cairo really does not provide a way to set PNG's &lt;code&gt;pHYs&lt;/code&gt; and Gnuplot also does not link libpng. It also really seems that libwebpmux does not provide a way to contruct the EXIF/TIFF payload. Do you have an idea of how to do this better?&lt;/p&gt;
&lt;p&gt;If you prefer, we could leave out the ugly part of the meta data manipulation altogether and just accept that the so created files will not have the resolution embedded. This might, however, lead to printing and text layout issues in some cases that users will not understand.&lt;/p&gt;
&lt;p&gt;As a start, I will separate out the DPI meta data embedding into its own commit, so it can be easily dropped and the code complexity of the main commit is reduced.&lt;/p&gt;
&lt;p&gt;Now for the goal and what we are trying to achieve: The main issue is that right now, the raster terminals are not very useful any more if you are working with high-DPI monitors, which is getting more and more common. A plot that looked great previously on monitors that were using resolutions below 100 DPI will not work any more for today's Retina, 4K, etc. displays. Most other plotting libraries support either a global scaling factor (e.g. ScottPlot, see &lt;a href="https://scottplot.net/faq/dpi-scaling/" rel="nofollow"&gt;https://scottplot.net/faq/dpi-scaling/&lt;/a&gt;) or explicit DPI settings (see savefig in MatPlotLib's docs: &lt;a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html" rel="nofollow"&gt;https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;It is true that there are some scaling options in Gnuplot already, but look at this Stackexchange post to see how cumbersome it is to get them all right to produce a plot at the proper size and DPI combo: &lt;a href="https://unix.stackexchange.com/questions/617823/gnuplot-setting-image-width-with-pixels-for-specific-dpi" rel="nofollow"&gt;https://unix.stackexchange.com/questions/617823/gnuplot-setting-image-width-with-pixels-for-specific-dpi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, &lt;code&gt;pointscale&lt;/code&gt;is not even available for the libgd terminals.&lt;/p&gt;
&lt;p&gt;So my point is that producing good-looking plots at journal-prescriped mandatory DPI is not the only advantage of implementing this patch: Many users that currently work with raster terminals have high-res monitors (think about all the Apple users out there)  and would want to user thicker lines, larger symbols and larger pixel dimensions per default. Currently, that means that they need to carefully set all the proper scaling themselves.&lt;/p&gt;
&lt;p&gt;Finally, parts of this were already implemented in the &lt;code&gt;cairolatex png&lt;/code&gt; terminal, so this patch uses an existing approach, at least for the cairo path. Since setting the size in cm or inches is already possible with the &lt;code&gt;size&lt;/code&gt; parameter and the scaling currently defaults to 72 DPI, it seems to be a natural extension to me to allow to set the resolution explicitly.&lt;/p&gt;
&lt;p&gt;And yes, users could alternatively go the route of producing vector output with pdfcairo and then rasterizing at a preferred DPI, but this requires knowledge about vector and raster graphics that many users do not have. Also, it requires additional processing steps that could be avoided.&lt;/p&gt;
&lt;p&gt;My suggestion would be to split this larger patch into several smaller:&lt;/p&gt;
&lt;p&gt;a) Everything pertaining to cairo (and maybe webp, as it is directly connected)&lt;br/&gt;
b) Everything pertaining to libgd&lt;br/&gt;
c) All the metadata injection.&lt;/p&gt;
&lt;p&gt;Would this work better for you?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#835 DPI support for raster terminals</title><link href="https://sourceforge.net/p/gnuplot/patches/835/?limit=25#eade/f648" rel="alternate"/><published>2026-04-24T10:27:44.207000Z</published><updated>2026-04-24T10:27:44.207000Z</updated><author><name>Sethur</name><uri>https://sourceforge.net/u/sethris/</uri></author><id>https://sourceforge.netb639f238f6834f1cd79d18257ad00fa767f1f35c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a Windows system on hand and can check whether this patch will fix the bugs you mentioned. I will post here again if I have an answer.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>