Page MenuHome

UI: Increase Size of Blend File Thumbnails
ClosedPublic

Authored by Harley Acheson (harley) on Feb 21 2021, 10:30 PM.

Details

Summary

Increase effective resolution of blend preview images from 128x128 to
256x256 for versions saved in the filesystem thumbnail cache.


Blender stores all thumbnail images on the file system as 256x256 GIFs. However, blend thumbnails are rendered at 256x256, scaled down to 128x128, then scaled back up to 256x256.

This patch makes it so that the file system thumbnails look good at 256x256, while the thumbnails embedded inside blender remain at 128x128. The following capture shows the difference in detail, the top showing how they look currently, the bottom how they look after this patch is applied.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Feb 21 2021, 10:30 PM
Harley Acheson (harley) created this revision.
Harley Acheson (harley) edited the summary of this revision. (Show Details)

Notes:

  • The images are stored in the blend file uncompressed, increasing the overhead to the file-size from 64kb to 256kb, while it's arguably acceptable, it might be a good time to store the thumbnail with compression.
  • By default the thumbnails in Blender's file browser only show 128x128px so this benefit is limited to when users view large thumbnails.
  • The note about scaling back up to 256 is an implementation detail that thumbnails are always written to 256x256 size, we could write smaller images, but this means keeping a second set of cache, see D9412: Cache normal/large thumbnails based on display size.

@Campbell Barton (campbellbarton) - Notes:
The images are stored in the blend file uncompressed, increasing the overhead to the file-size from 64kb to 256kb, while it's arguably acceptable, it might be a good time to store the thumbnail with compression.

Yes, it might be nice to store those compressed. Although without doing so this just means that a blend file will be only 196,608 bytes larger, or so.

By default the thumbnails in Blender's file browser only show 128x128px so this benefit is limited to when users view large thumbnails.

Whatever is set by us to be the default doesn't really have much bearing on what users ultimately decide to show, or how they will change it throughout their sessions. Not only is the added detail needed for "large" thumbnails, it is needed for "regular" when the scale is larger than 1.0. And for everyone using high-dpi monitors like Retina.

But the best reason for this change is that it is not a change. We have (collectively) already decided how detailed thumbnails should be, by creating them at 256x256 for images, videos, and even for fonts. We'd want them to be at least as detailed for our blends, otherwise our stuff looks worse in comparison.

The note about scaling back up to 256 is an implementation detail that thumbnails are always written to 256x256 size, we could write smaller images, but this means keeping a second set of cache, see D9412: Cache normal/large thumbnails based on display size.

Not sure that simply saving these to the file system in a smaller size serves any purpose. A 256x256 png thumbnail might take up 56k, while a 128x128 version might be only 29k. But you'd have to save both every time because how I am viewing thumbnails at this moment has no bearing on how I might wish to see them later on. Or we'd just save them in the smaller size and we'd be at the same place we are now, with fuzzy thumbnails but saving 27k on the file system.

Although without doing so this just means that a blend file will be only 196,608 bytes larger, or so.

Are you saying this makes every .blend file 200KB bigger? I think that's too much.

Harley Acheson (harley) planned changes to this revision.Feb 22 2021, 5:59 PM

Although without doing so this just means that a blend file will be only 196,608 bytes larger, or so.

Are you saying this makes every .blend file 200KB bigger? I think that's too much.

No worries. Will quickly take a look to see if I can save a nicer thumbnail image while keeping the internal bitmap the same. At least that would be nicer is many cases, until we can save them internally compressed.

Harley Acheson (harley) updated this revision to Diff 34299.EditedFeb 22 2021, 11:44 PM
Harley Acheson (harley) edited the summary of this revision. (Show Details)

Now the thumbnails embedded inside blender are not touched - they remain at 128x128 so the file size does not change. However the filesystem thumbnails are made to look good at 256x256.

The new logic depends on fixed sizes which are set elsewhere.

It's not clear why 2x and 4x are used in this patch, without knowing the reasoning behind the changes.

Suggest to add defines for THB_NORMAL, THB_LARGE sizes in pixels.

Then the logic of this patch will read much more logically.

As BLEN_THUMB_SIZE * 4, is really intended to be THB_LARGE_SIZE_PX * 2.

... and below ...

IMB_scaleImBuf(ibuf, THB_LARGE_SIZE_PX, THB_LARGE_SIZE_PX);

Updating to current state of master.

Also adding define for our current 256-pixel thumbnail size to make the code a little clearer.

This revision is now accepted and ready to land.Sep 6 2021, 4:10 AM
Harley Acheson (harley) retitled this revision from UI: Increase Size of Blend Thumbs to UI: Increase Size of Blend File Thumbnails.Sep 6 2021, 4:52 AM
Harley Acheson (harley) edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.