Creating Custom Element Graphics From .jpeg Images Without Dramatically Increasing Model Size
GoldSim only supports metafiles as custom element icons. I want to use a .jpeg file. How do I do this without making a huge model file?
JPG files are highly compressed when saved on disk, but in memory (or in a GS file) the compressed data must be uncompressed and kept in memory. If you try to use a large .jpg this will result in a large model file and excessive memory use (even if the icon is scaled down to normal element icon size). Therefore, it's important to adjust the size of images before importing them as element icons. There are many tools that can be used to resize the image and convert it to a metafile but a simple tool is IrfanView
, which is free for non-commercial work and a small donation if you need to use it for commercial work. In IrfanView you need to load your JPG image, then select ‘Image Resize/Resample…’ from the Image menu.
In the dialog, change the Width to an appropriate value (a standard GoldSim element icon is 100 pixels wide). Then save the image as an EMF file.
The last step is to import the new image as the new element symbol. After you selected the new file you will see the following message box:
You should select ‘No’. As a result you will see the image with its native dimensions. If the image is too large, and you therefore scale it down, you will waste memory as lots of the picture details are not actually visible, but are still in the model file. If the image is too small, and you scale it up, you will have a small file size, but a not so great picture quality. The goal is to use the image with the size it was saved with in the image editor.