Re: Exporting image files #HowTo #dxf


Tony Scott
 

Adam

A couple of things. I'm not using GIMP - not sure how that idea cropped up. Also, I know that JPGs reduce file size considerably. What I didn't know, because XTrack makes no mention of it, is that the exported BMP file has to be further processed - into a JPG or whatever. This is a real shortcoming and has frustrated me for years. It would be great if you could add a JPG (or whatever you think is the best file type) option to the Export command.

Cheers
Tony

------ Original Message ------
From: "Adam Richards" <adamjmrichards@gmail.com>
To: main@xtrackcad.groups.io
Sent: 21-Jan-20 2:45:15 AM
Subject: Re: [xtrackcad] Exporting image files #HowTo


Tony,
A BMP as I noted is a dump of bits (no compression). This means you have a large file with every pixels x color depth in it. If you scale them they attempt to fill in the blanks by interpolation. That process necessarily smudges fine details because the edge is an edge but the scaling doesn't know that and produces either a fatter copy or a gradient depending on the contents of the two pixels. This is also true as the image scales down where the choice is what to make each output bit. Basically, unless you use the BMP at its original size the result will be poor.

My apologies, I had assumed you knew that formats such as JPGs were designed to reduce the size of an image while preserving the detail by running a compression algorithm. The JPEG algorithm was originally created to compress huge images into a form that did not lose fidelity when scaled, in fact. I thought that would be the reason you were using GIMP!!

One of the characteristics of JPG is to encode the edges since, in effect, the displayed image is always "scaled" to get back to the original. That makes a JPG better (although not perfect) at scaling especially down. The quality setting on the JPG export will enable you to balance file size versus scalability. More compression (lower quality) gives a smaller file but loses some detail - this means the result will be OK if scaled down from the original but may suffer as it scales up compared to high quality (less compression, bigger file). In all cases of a layout, where there are comparatively large areas of single colors (including white) compression can be highly effective.

So overall, exporting a BMP as large as you can, and then encoding it as a JPG will result in a smaller but high quality file.

We could add a JPG output option - at least in V6. GTK natively supports the output format, so once we are on a unified UI it will be simple to do. I have added it to the solution requests.

Adam

Join main@xtrackcad.groups.io to automatically receive all group messages.