Convert Image... for webp files

Hi again team!

I would like to ask if it is possible to enable convert Convert Image... menu for webp files?
I know that the plugin is working fine for opening a webp file in image viewer and then save it as png.
I have many files that I would like to convert and is boring saving file by file.

Is there another way or with a script using the plugin?

Thank you in advance!

J!

If you add .webp to the list of extensions for the Images filetype group the menu should show up automatically.

2 Likes

Nice!!!
Great job as always!!!
Thank you!

J!

I've tried to achieve this by doing what Jon has said but i can't seem to get it to work. Would anyone be able to show screenshots so i can see what i'm doing wrong?

I've gone to:

Settings > File Types... > File Type Groups > Images

And in the Edit 'Images" File Type Group the .webp extension is already listed but i only get GIF, JPEG, PNG, BMP in the Convert Images dialog box when i right click on some .PNG files to try and convert them to .webp.

You can only convert from WebP to the other formats. There's nothing built-in to convert to WebP, but you could use an external conversion tool and set up a button or menu item which runs it on other image types to convert them to WebP.

(ImageMagick is often a good choice, since it handles a lot of formats and is easy to automate via command line args, making it easy to use in Opus buttons/menus. I haven't checked if it supports WebP, but I expect it does by now.)

Leo,

ahhh that's what info i was missing, thanks. I wonder could i use GIMP to do the automated method you speak of. I'll try to look into that when i get the time.

Thanks again.

I have used ImageMagick in a situation like this and it is working great! You need a program with a Command Line Interface. I don't think GIMP ins working like that.

J!

ImageMagick works fine.

@nodeselect
magick.exe convert {filepath} -quality 50 {filepath|ext=webp}
3 Likes

Would anyone smarter then me be able to confirm if this is the correct command to get lossless conversion done to .webp format please? I'm trying to achieve a .png equivalent with alpha channel and lossless for screenshots etc.

@nodeselect
magick.exe convert {filepath} -quality 50 -define webp:lossless=true {filepath|ext=webp}

Something tells me i could remove the -quality entry but i'm not sure.

WebP -> PNG converstion is built into Opus. It should be an option when you right-click a WebP file.

Thanks Leo but i think you misread. I'm wanting to go from png to webp and wanted clarification building on lxp's helpful code. I'm slightly unsure because the sample code on ImageMagick's website in the webp listing shows both the -quality and lossless settings existing int he same line even though i think enableing lossless would negate any quality setting... but again.. i'm not sure. :slight_smile:

Just a bump from me for OPUS to natively support converting to .WEBP. Its popularity seems to be rising, and for good reason.

Opus already supports displaying WebP files, and converting them to other formats.

Or do you want to convert other formats into WebP? You can hook up an Opus button (etc.) with a tool like ImageMagick to do that (although the rest of the world would rather you didn't :slight_smile: ).

1 Like

Yeah I'm looking for the "Convert" function in Opus to support converting, say, an .HEIC or .JPG into .WEBP!

1 Like

We may add that built-in in the future, but not the near future. Setting up ImageMagick to do it (e.g. using the buttons above in this thread) is very easy, though.

Leo when you say the option to convert WebP to JPEG when the file is right-clicked do you mean to click the file to select it and then go up to the toolbar menu or that it should appear on my right-click menu with the other options like open or copy? If you mean the right-click pop-up menu, then how do I get it back? I tend to click things to learn what they do and not remember to put things back when I am done playing. I have been using Dopus for years but I love that it is still way over my head.

The quickest way is to go to Settings > File Types, right-click the Images group, and reset it to defaults.

That's assuming you haven't made any customisations to the group or its commands that you want to keep.

Resetting it will ensure the webp extension is included in the group, and the convert option is in the group's context menu.

1 Like

That worked. Thanks

My Bro. This really helped me a lot. Also, what should I do if I want to delete the original image while converting it?

1 Like

Add a line with

Delete

or

Delete QUIET