How to save an Image without compression or filtered
when I save a file, it loses quality. This is due to compression or filtering. Well, in any case, I just need to ensure that the quality is not lost while maintaining it!
Well, no dice, it’s not something in the code you posted and there are no notes in the docs, so if you’re seeing a viewport on screen it should be saved lossless afaik. What happens if you skip the convert? Can you provide a screenshot and the saved image for comparison?
I think there is no compression here. But in any case, my question was whether it was possible to save the image from viewports somehow. Without loss of quality? I gave a small script above
extends Node
@onready var captured_image = $CapturedImage
func _on_CaptureButton_pressed():
# Retrieve the captured image.
var img = get_viewport().get_texture().get_image()
# Create a texture for it.
var tex = ImageTexture.create_from_image(img)
# Set the texture to the captured image node.
captured_image.set_texture(tex)