Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Daniel-Pablo's avatar

how to Spatie Media library convert image PNG to jpg

Hi I am trying to convert a PNG image to JPG using the media library of spatie but really I cant find how...

do you know how the PNG can be saved as jpg?

0 likes
5 replies
SilenceBringer's avatar
Level 55

@arius tigger you can't convert the original image, if it's your question. But you can add conversion without any changing the size or anything else. This way you'll have original image converted to jpg. Of course, you'll need to call the conversion instead of original image to output jpg.

Daniel-Pablo's avatar

@silencebringer thanks a lot, yes this is what I need, nobody makes a response because it's an obvious thing I mean for every person that knows that but as I read your comment I realize that this is the way , thanks for your response, Spatie must convert the image and give an output

olafosunadp's avatar

It's been a very very long time but, to convert a PNG to JPG using Spatial Media Library, you can simply use the manipulations feature. Just add ->format('jpg') to your image manipulation chain.

Please or to participate in this conversation.