I create a shader that changes the parameters of the texture (brightness, saturation, etc.).
After manipulating the image, I need to upload it in .png format. But the original image is preserved unchanged.
You want to save a .png file with the modifications, correct?
Shaders only apply on the GPU, so you need some way to copy the data from the GPU back to the CPU. To do that you need to render your material to a RenderTexture using a Blit(), then create a Texture2D with the same dimensions and format as the render texture and use ReadPixels() to copy the render texture to the CPU memory. Then you can use EncodeToPNG() to convert the image to a png and save the resulting data to disk.
Because you’re trying to grab the texture from a material you’re using on a UI element, which has no texture assigned. The texture being used in your example is the sprite assigned to the image component, which is setting the texture to use at runtime when displaying that UI component.
For a Blit you need a Texture2D, not a sprite. Also you need to assign a material to use with the Blit otherwise it’s just making a copy of the original image unmodified.