1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Use Lanczos filtering for variable-sized images such as project icons

This results in better-looking icons with less artifacts
induced by downscaling.
This commit is contained in:
Hugo Locurcio
2019-08-13 22:08:23 +02:00
parent fcec358840
commit 8f2bcfd909
2 changed files with 2 additions and 2 deletions

View File

@@ -758,7 +758,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
switch (image_queue[p_queue_id].image_type) { switch (image_queue[p_queue_id].image_type) {
case IMAGE_QUEUE_ICON: case IMAGE_QUEUE_ICON:
image->resize(64 * EDSCALE, 64 * EDSCALE, Image::INTERPOLATE_CUBIC); image->resize(64 * EDSCALE, 64 * EDSCALE, Image::INTERPOLATE_LANCZOS);
break; break;
case IMAGE_QUEUE_THUMBNAIL: { case IMAGE_QUEUE_THUMBNAIL: {

View File

@@ -1109,7 +1109,7 @@ void ProjectList::load_project_icon(int p_index) {
Error err = img->load(item.icon.replace_first("res://", item.path + "/")); Error err = img->load(item.icon.replace_first("res://", item.path + "/"));
if (err == OK) { if (err == OK) {
img->resize(default_icon->get_width(), default_icon->get_height()); img->resize(default_icon->get_width(), default_icon->get_height(), Image::INTERPOLATE_LANCZOS);
Ref<ImageTexture> it = memnew(ImageTexture); Ref<ImageTexture> it = memnew(ImageTexture);
it->create_from_image(img); it->create_from_image(img);
icon = it; icon = it;