Ditto icon indicating copy to clipboard operation
Ditto copied to clipboard

ditto messes with the alpha channel of copied graphics

Open Ulf3000 opened this issue 2 years ago • 6 comments

the program is nice , but i cannot use it efficiently for graphics related work where i must retain the alpha channel of copied graphics.

it will fill the alpha channel with black if i paste from ditto to a graphics program.

can you fix that ?

Ulf3000 avatar Dec 23 '23 13:12 Ulf3000

You need to describe more information. For image copy & paste, each application has own process logic. So, please describe where and what did you copy and where did you paste. Even though it doesn't support CF_DIBV5 yet, CF_DIB already has an alpha value. (You can copy this and paste it into MS Paint 3d or PowerPoint to see it works)

PzaThief avatar Dec 29 '23 11:12 PzaThief

CF_DIB already has an alpha value. (You can copy this and paste it into MS Paint 3d or PowerPoint to see it works)

doesnt work if i paste it to clipstudio/photoshop/krita/blender.

CF_DIB supports alpha but ditto overwrites the alpha channel somehow. Same with any content copied from and back into any graphics program.

without ditto it works like it should. with ditto alpha areas will just fill with black aka the alpha channel is overwritten

theres a competitor to ditto called copyq which handles this correctly , but i like the ui and search from ditto much better. Maybe you can find the missing code in copyq´s repo.

Ulf3000 avatar Dec 29 '23 11:12 Ulf3000

Thank you for information, please give me some time. I'll dig it.

PzaThief avatar Dec 29 '23 11:12 PzaThief

With some tries, I found several things we need to know.

First, Ditto does not messes alpha channel in CF_DIB. it was Windows behavior. you can find messed image equally with terminate Ditto and use Windows clipboard(Win+v) nevertheless if program can use other information like CF_HDROP (file information, used to darg&drop), it appears that it works correctly.

However Ditto skips many things we want to keep exclude CF_HDROP. Even though CF_DIB is messed already, you might feel weird only with Ditto. Whereas window clipboard has many file format by clip, Ditto only accepts those listed in the 'Supported Types' option tab.. So many of information will be lost include PNG format not listed on the option by default. Now the paste part program only can receive corrupted CF_DIB.

Now we know solution is just adding supported format, but it seems to common issue to happens so easily. So I made an experimental PR to avoid this issue. it makes PNG as default support format and use an option to accept all format from clipboard.

Please tell me if you need or just opinion about PR is welcome. Happy new year~

PzaThief avatar Jan 04 '24 01:01 PzaThief

any update on this ?

Ulf3000 avatar May 21 '24 18:05 Ulf3000

Nothing to update on this. But as last my comment, you can use experimental advanced option that "support all types ignoring ~~". This option makes Ditto not mess any information from copies. Please try this option and let me know if it helps or not.

PzaThief avatar May 22 '24 00:05 PzaThief