tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Add option to use smooth scaling regardless of current scale

Open bjorn opened this issue 11 months ago • 0 comments

Problem

Currently Tiled determines whether to perform smooth scaling when rendering images based on the current zoom level. When it is 100%, 200%, 300%, etc., nearest-neighbor scaling is used and smooth scaling is only used when scaling down or for values in between.

In general, this makes the map look fine both when it is scaled down as well as when it is scaled up (especially pixel art). However, this logic predates the support for resized and rotated tile objects. When resizing or rotating tile objects, it can be desired to apply a smooth rendering algorithm regardless of the view scale.

Solution

The solution might be to add an explicit "Texture filtering" option (not sure about name), either in View menu or Preferences. Possible values could include "Nearest Neighbor", "Smooth" and "Auto" (the current behavior). In addition, when we keep "Auto" as the default behavior, it might be a good idea to enhance it a little, so that scaled-down tile objects are smoothly rendered.

This new option should also affect the "Export as Image" action.

The tmxrasterizer tool already applies smooth rendering by default and provides a --no-smoothing parameter to disable it.

bjorn avatar Aug 03 '23 15:08 bjorn