Naming issue while using MiniMagick metal in uploader

Sorry another silly question

I am converting a PNG 24bit or 32bits into a PNG 8BIT with Image Magick.
In Image Magick I couldn’t find a way to do it through arguments, especially -palette. -palette does convert to PNG 8 BIt but it makes the file differrent than doing the plain :
convert a.png PNG8:b.png

Then in my Shrine uploader I have played with the metal: I take an image from the vips_pipeline and convert it straight to PNG8bit :

    png8tempfile = Tempfile.new(SecureRandom.uuid.to_s)	    
	png8bit = MiniMagick::Tool::Convert.new   		
	png8bit << vips_pipeline.call.path	
	png8bit << "PNG8:#{png8tempfile.path}"		
	png8bit.call
	results["png not qzed".to_sym] =  png8tempfile
	byebug
	results

It works perfectly yet the name of the file is missing the “.png” in the end.
The browser is understanding this is a PNG image and does show it properly but if the user wants to save it, the extension is missing.

I have been thinking of ading an extension to my Tempfile :
png8tempfile = Tempfile.new(SecureRandom.uuid.to_s+'.png')
But Shrine is rehashing the name to ‘whateverchain.pngwhateverchein’ and the filename is still not showing any extension.

Would it be possible to add the extension in the uploader ?
(I have been thinking of manipulating the derivatives hash outside the uploader but it is a bit hacky)

Thaaaaaanks

Sorry, it has nothing to do with Shrine.
I am a bit unexperienced with naming tempfiles. The below works :
png8tempfile = Tempfile.new(["png_not_quantized",".png"])

(I leave the question here in case someone is trying to use MiniMagick Metal)