Watermarked images lack full transparency
Moderators: XnTriq, helmut, xnview
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Watermarked images lack full transparency
I have written a utility that calls Nconvert in shell commands. It works, however the images white space causes the converted WATERMARK'ed images to be partially invisible. That is the watermark partially is hidden by the white space.
When I use the UI of XnConvert on the same, I see that immediately upon opening the original image has a checkerboard background on the image. The watermark images appear correctly on these. I looked in XNconvert fpr options and I can't find how it does this.
Is there are a way to put the checked background or (something else ) on the COMMAND line options.
I tried "-back g" but it had no effect.
I need to find this soon......
Thanks for any help.
Phil
When I use the UI of XnConvert on the same, I see that immediately upon opening the original image has a checkerboard background on the image. The watermark images appear correctly on these. I looked in XNconvert fpr options and I can't find how it does this.
Is there are a way to put the checked background or (something else ) on the COMMAND line options.
I tried "-back g" but it had no effect.
I need to find this soon......
Thanks for any help.
Phil
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
I am not very familiar with transparency, unfortunately, but looking quickly at the NConvert help file I see the following options which you have probably already found, there may possibly be more:
Have you used the XnConvert option on the 'Actions' tab (bottom left) to export the code for NConvert, to examine?
I would suggest that, if possible, you post an example image to be watermarked, the watermark file, your code, and the resulting watermarked image.
I don't know whether you may have found a bug, or whether your code need to be modified.
The forum transparency expert rarely posts on NConvert topics, but maybe Pierre can comment?
Code: Select all
-add_alpha value : Add alpha channel (24bits)
-merge_alpha : Merge alpha by using 'transparent color' (32bits)
-set_alpha : Add alpha by using 'transparent color' (32bits)
-transparent value: Transparency index (GIF/PNG)
-transpcolor red green blue: Transparency color (GIF/PNG
Have you used the XnConvert option on the 'Actions' tab (bottom left) to export the code for NConvert, to examine?
I would suggest that, if possible, you post an example image to be watermarked, the watermark file, your code, and the resulting watermarked image.
I don't know whether you may have found a bug, or whether your code need to be modified.
The forum transparency expert rarely posts on NConvert topics, but maybe Pierre can comment?
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
Hello, thanks for your response.
My question is more about Background. When I see a raw image, the back ground is white. Now, when I open that image with Xnconvert (the UI) it does this:
(See the image attached.)
XnConvert places a pattern on the white space. Is there a way to do that with the command line utility NCONVERT?
My question is more about Background. When I see a raw image, the back ground is white. Now, when I open that image with Xnconvert (the UI) it does this:
(See the image attached.)
XnConvert places a pattern on the white space. Is there a way to do that with the command line utility NCONVERT?
You do not have the required permissions to view the files attached to this post.
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
The checkerboard pattern in the image you posted above indicates transparency, do I understand that you are trying to apply a watermark file (also with transparency) to that file?
When loaded in XnConvert the image displays as above in the preview, but have you tried watermarking the image in that program?
When loaded in XnConvert the image displays as above in the preview, but have you tried watermarking the image in that program?
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
Yes, I have watermarked that image you in my example, and the watermark appears. Seems like transparency is what I am looking to implement.
When you say Transparency, what can I use on the command line?
I see this, but what values do you use?
-add_alpha value : Add alpha channel (24bits)
-merge_alpha : Merge alpha by using 'transparent color' (32bits)
-set_alpha : Add alpha by using 'transparent color' (32bits)
-transparent value: Transparency index (GIF/PNG)
-transpcolor red green blue: Transparency color (GIF/PNG)
My command:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ_LOGO.png FLZ123.PNG
Thanks
When you say Transparency, what can I use on the command line?
I see this, but what values do you use?
-add_alpha value : Add alpha channel (24bits)
-merge_alpha : Merge alpha by using 'transparent color' (32bits)
-set_alpha : Add alpha by using 'transparent color' (32bits)
-transparent value: Transparency index (GIF/PNG)
-transpcolor red green blue: Transparency color (GIF/PNG)
My command:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ_LOGO.png FLZ123.PNG
Thanks
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
So XnConvert produces the result you need? Have you exported the code as suggested above, and if so could you post it?
I'm afraid I don't know enough about transparency to help, maybe XnTriq or Pierre can comment
I'm afraid I don't know enough about transparency to help, maybe XnTriq or Pierre can comment
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
HI, thanks again.
I don't know what you mean "Exported". That is Windows shell command I am using as a test.
Maybe it is the image viewer I am using. Do you see how that corner of the watermark is "gone"?
Still, if someone knows how to use the TRANSparency commands on the command line, that would be very helpful.
Thanks again.
PD
I don't know what you mean "Exported". That is Windows shell command I am using as a test.
Maybe it is the image viewer I am using. Do you see how that corner of the watermark is "gone"?
Still, if someone knows how to use the TRANSparency commands on the command line, that would be very helpful.
Thanks again.
PD
You do not have the required permissions to view the files attached to this post.
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
The problem is that the top-left part of the small image on the right is white rather than clear, presumably?
It looks as it the 'watermark' image is behind the main image, possibly you need to reverse the images so that the watermark is in front, if that makes any sense? You could possibly try reversing the 'watermark' and 'main' files in your script and see the effect.
So you could try replacing your existing code:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ_LOGO.png FLZ123.PNG
With this code:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ123.PNG FLZ_LOGO.png
It looks as it the 'watermark' image is behind the main image, possibly you need to reverse the images so that the watermark is in front, if that makes any sense? You could possibly try reversing the 'watermark' and 'main' files in your script and see the effect.
So you could try replacing your existing code:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ_LOGO.png FLZ123.PNG
With this code:
"C:\Program Files\XnView\nconvert.exe" -o 1236_FLZ.png -out png -ratio -rtype lanczos -resize 1024 1024 -wmopacity 40 -wmflag center -wmfile FLZ123.PNG FLZ_LOGO.png
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
That is a good idea, but it causes a very strange effect.
From my experience with this tool, -wm commands must be followed with the watermarked file. Otherwise it uses the main image as the watermark.
From my experience with this tool, -wm commands must be followed with the watermarked file. Otherwise it uses the main image as the watermark.
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
The question is which file with transparency should be in the front, a 'watermark' is normally placed in front of an image, which normally doesn't have transparency...pdnavistar wrote: ↑Mon Apr 06, 2020 8:41 pm That is a good idea, but it causes a very strange effect.
From my experience with this tool, -wm commands must be followed with the watermarked file. Otherwise it uses the main image as the watermark.
So this case, if I understand it correctly, is unusual as both files have transparency.
But reversing the files as above doesn't produce the desired result?
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
No switching the files does not work. The entire image is cropped to the size of the watermark. No not right.
Yes, the watermark is placed in front and is transparent. That seems to work.
But some of the watermark is become lost (covered??) in the white space, as I showed in the image. The left corner of the transparent watermark was missing.
Yes, the watermark is placed in front and is transparent. That seems to work.
But some of the watermark is become lost (covered??) in the white space, as I showed in the image. The left corner of the transparent watermark was missing.
-
- XnThusiast
- Posts: 4132
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Watermarked images lack full transparency
I'm sorry, but as I said I'm not very knowledgeable on transparency, and I think you are trying to do something rather unusual.
You have now posted your code, but the only chance I can see to possibly make progress would be if you can upload example test images, not necessarily the actual images you are working with, but files with which the problem can be reproduced. Then, maybe, someone will be able identify the problem...
You have now posted your code, but the only chance I can see to possibly make progress would be if you can upload example test images, not necessarily the actual images you are working with, but files with which the problem can be reproduced. Then, maybe, someone will be able identify the problem...
-
- Posts: 7
- Joined: Mon Apr 06, 2020 12:40 pm
Re: Watermarked images lack full transparency
Right, well I thank you for your many answers and ideas. You have have helped me.
You know, I think it may be working as expected now.
But, there is a real problem in what image viewer is used. The new Windows 10 image viewers are worse than the old Paint program.
(how does Microsoft constantly makes things worse?)
It is the new Win 10 viewer that shows the watermark partially missing (in my attached image). In the old Paint program and the Xnviewer, the converted image looks pretty good. Although. I need more transparency for the watermark, that watermark is completely visible.
Man, this is complicated.
You know, I think it may be working as expected now.
But, there is a real problem in what image viewer is used. The new Windows 10 image viewers are worse than the old Paint program.
(how does Microsoft constantly makes things worse?)
It is the new Win 10 viewer that shows the watermark partially missing (in my attached image). In the old Paint program and the Xnviewer, the converted image looks pretty good. Although. I need more transparency for the watermark, that watermark is completely visible.
Man, this is complicated.
-
- Author of XnView
- Posts: 44451
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Watermarked images lack full transparency
could you post original image and what you would like to obtain?pdnavistar wrote: ↑Mon Apr 06, 2020 9:37 pm It is the new Win 10 viewer that shows the watermark partially missing (in my attached image). In the old Paint program and the Xnviewer, the converted image looks pretty good. Although. I need more transparency for the watermark, that watermark is completely visible.
Pierre.