Can't convert PNG to WebP

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Can't convert PNG to WebP

Post by dedbombom »

nconvert -v -out webp -o 11.webp -q 80 -in png 11.png
** NCONVERT v7.80 (c) 1991-2021 Pierre-E Gougelet (Apr 27 2021/08:27:27) **
Version for Windows Xp/Vista/7 x64 (All rights reserved)
** This is freeware software (for non-commercial use)

A Portable Network Graphics (RGB) - ZIP was recognized : 11.png
Width:816 Height:624 with 256 colors
Nplanes : 1 Bitscount : 8
Bytes Per Plane : 816
xdpi : 0 ydpi : 0
Error: This picture cannot be written using this format (11.webp)

##########################Files opened: 1
Files written: 0
Files with write error: 1
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4142
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Can't convert to WebP

Post by cday »

Do you have libwebp.dll installed in the NConvert Plugins folder?

I'm not personally familiar with WebP, but the following thread refers Converting from Jpeg to Webp.

That thread is nearly two years old, if the plugin isn't available as a direct download, I understand Pierre's reference to the 'XnView package' as referring to the plugin being included in the XnView Classic 'Extended' version download.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

cday wrote: Tue May 18, 2021 7:53 pm Do you have libwebp.dll installed in the NConvert Plugins folder?

I'm not personally familiar with WebP, but the following thread refers Converting from Jpeg to Webp.

That thread is nearly two years old, if the plugin isn't available as a direct download, I understand Pierre's reference to the 'XnView package' as referring to the plugin being included in the XnView Classic 'Extended' version download.
Sure I have needed plugin and I've compressed tons of png's to webp without problems but just found some game that have such png images that can't be compressed to other formats (tried jpg and webp) with nconvert. Also this image can be converted with other tools such as pingo and cwebp to webp just nconvert can't process this file but I've used to it so I wanna that develpers fix this issue if possible, please...
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert to WebP

Post by xnview »

webp doesn't support 256 colors, please use -truecolors
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

Now it worked, thanks! But I have 2 questions: will it affect other images if I convert all images with this switch by default and since other tools mentioned by me can convert this file it means that there were implemented some workaround for such cases so maybe u can make something similar in nconvert?
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert to WebP

Post by xnview »

dedbombom wrote: Wed May 19, 2021 8:15 am Now it worked, thanks! But I have 2 questions: will it affect other images if I convert all images with this switch by default and since other tools mentioned by me can convert this file it means that there were implemented some workaround for such cases so maybe u can make something similar in nconvert?
If picture files are already in 24/32bits, there is no change. And yes other apps convert them automatically
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert PNG to WebP

Post by dedbombom »

Should I create new topic for question about not able to process for nconvert webp files created with this tool https://developers.google.com/speed/webp/docs/gif2webp?
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert PNG to WebP

Post by xnview »

dedbombom wrote: Fri May 21, 2021 4:30 pm Should I create new topic for question about not able to process for nconvert webp files created with this tool https://developers.google.com/speed/webp/docs/gif2webp?
yes please
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

xnview wrote: Thu May 20, 2021 1:41 pm
dedbombom wrote: Wed May 19, 2021 8:15 am Now it worked, thanks! But I have 2 questions: will it affect other images if I convert all images with this switch by default and since other tools mentioned by me can convert this file it means that there were implemented some workaround for such cases so maybe u can make something similar in nconvert?
If picture files are already in 24/32bits, there is no change. And yes other apps convert them automatically
Hi! I found out that with "-truecolors" switch png files with transparency after webp conversion becames broken. I've uploaded 2 webp file examples here https://workupload.com/file/YytemV7LseV with -truecolors and without (x-patreon_1.webp) and original file in attachment.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert to WebP

Post by xnview »

it's better to use -merge_alpha, -truecolors remove alpha channel
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

xnview wrote: Mon May 02, 2022 6:42 am it's better to use -merge_alpha, -truecolors remove alpha channel
Thanks but merge_alpha just made image white as with truecolors. Anyway is there are a working method to convert 256 color transparent png to webp with ncovert without losing transparency coz I never spotted such problems it any other tools so it's most likely a real problem and since their developers solved somehow this problem why you can't do the same with nconvert please?
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert to WebP

Post by xnview »

dedbombom wrote: Mon Dec 12, 2022 6:05 pm
xnview wrote: Mon May 02, 2022 6:42 am it's better to use -merge_alpha, -truecolors remove alpha channel
Thanks but merge_alpha just made image white as with truecolors. Anyway is there are a working method to convert 256 color transparent png to webp with ncovert without losing transparency coz I never spotted such problems it any other tools so it's most likely a real problem and since their developers solved somehow this problem why you can't do the same with nconvert please?
So if i understand correctly, you would like to convert 256 colors image with transparency as 32bits WebP, and 32bits image as 32bits WebP, right?
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

xnview wrote: Sat Dec 31, 2022 12:53 pm
dedbombom wrote: Mon Dec 12, 2022 6:05 pm
xnview wrote: Mon May 02, 2022 6:42 am it's better to use -merge_alpha, -truecolors remove alpha channel
Thanks but merge_alpha just made image white as with truecolors. Anyway is there are a working method to convert 256 color transparent png to webp with ncovert without losing transparency coz I never spotted such problems it any other tools so it's most likely a real problem and since their developers solved somehow this problem why you can't do the same with nconvert please?
So if i understand correctly, you would like to convert 256 colors image with transparency as 32bits WebP, and 32bits image as 32bits WebP, right?
Yes and no, I often convert (with nconvert) any images to webp so I just want if nconvert "spots" 256 color (png or actually any other format) images with transparency it just do its job correctly and don't stuck or just removed transparency at all. I don't care of how many bits it would have just size should be still resonable for webp. For now I tried all mentioned here commands and they all remove transparency for such files (produces white images as output).
Can you write plz fully working (tested by you first) command that convert (lossy) such file download/file.php?id=8787 to webp and don't lose transparency?
User avatar
xnview
Author of XnView
Posts: 44616
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Can't convert to WebP

Post by xnview »

I don't understand, by default, if you convert png->webP, the alpha is not lost
x-patreon.zip
You do not have the required permissions to view the files attached to this post.
Pierre.
dedbombom
Posts: 39
Joined: Tue May 18, 2021 3:22 pm

Re: Can't convert to WebP

Post by dedbombom »

xnview wrote: Mon Jan 02, 2023 9:27 am I don't understand, by default, if you convert png->webP, the alpha is not lost
x-patreon.zip
Sry, something wrong with attached file. It wasn't 256 color, here is correct one https://workupload.com/file/N2nWPR9C3sm