Is there any technical reason one should prefer png over jpg or the opposite in a module creation?

PNG has better compression and supports transparency (important if you have any non-rectilinear pieces). There are no compelling reasons to use JPGs that I’m aware of.

JPG in general offers much better compression than PNG, however, it does this by throwing away some of the image data and you will lose definition, especially when you zoom in. PNG compression is only better than JPG if you have long lines of the same colour in the image. JPG is designed to store photos and images where colours change gradually across the image. It does not do well with sharp colour transitions like lines and letters. You will see ‘JPG artifacts’ that look like blurs and smudges.

In general, you will almost always want to use PNG for images for counters, charts and any art with lines or letters.

For general background artwork, you can probably get away with JPG, depending on the image.

For maps it can go either way. Generally you will want to use to PNG. However, depending on the artwork, you can get away with JPG. For some of my modules, I had very high definition map artwork and large hex sizes and the size of the PNG images was astronomical. I found I could use JPG format with a compression factor of ‘90’ and got a substantial reduction in the image sizes over PNG with an acceptable reduction in viewable image quality. In my case, the maps where very ‘busy’ visually, so you do not tend to notice the JPG artifacts so much. You will find others who disagree and never use JPG, but in my case, my module was blowing out to 100’s of megabytes. All my counters are PNG.

During development, I keep all artwork as PNG and only change specific images to JPG at the very end before storing them in the module. If I need to make changes, I go back to the PNG, edit it and then re-convert to JPG at the last moment. Your images will degrade over time if you make ongoing changes to them and keep saving them as JPG’s.

Hope this helps.