Graphics inserting: 24-bit only for PNGs?

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello,

I am having a slightly annoying problem with the - actually VERY NICE! - feature of H&M that lets you insert a screenshot from the clipboard directly, and on saving even suggests the proper image name (next-higher in numbering).
This is something I really love to use. Saves a lot of time!
But, found out that all screenshots inserted this way are saved as 24-bit (when using png format).

Which excludes transparency.

For a PNG to retain transparency, it must be 32-bit - so I have learned by now.

My preferred image editor and screenshot-maker does copy the screenshot image to the clipboard all right and with transparency.
It can handle this OK when inserted from clipboard, then saved.
For the sake of science, I have also tried this with other editors and screenshot-capture-programs (but not yet with Impict, I have to admit!)
The results are the same: it's not the capture program's fault.
Images get copied to clipboard always OK, and with full transparency; can be inserted as-is into their respective editor program, can be saved OK there -- but inserting any images directly from clipboard into H&M and saving them then and there as PNG, always results in a 24-bit-PNG.

It is really just when any image is inserted by copy-and-paste into the H&M editor, and then saved, that it becomes a 24-bit PNG, effectively losing transparency.

The H&M save dialog box, at this point, does not offer any options on *how* to save this file - no selection about bit-depth or the like is possible.
So, is this maybe a H&M default, at this point? To save inserted images always as 24-bit?

---
In our project, we like to have screenshots with 'ripped' edges to indicate 'this is not all you will see at this point, this is only the important part!' to users reading our help - and the non-transparent PNGs are really annoying on a gray background (which we e.g. use on all of our 'expandable' topics), because the background parts between the 'ripped edges' and the actual image size will show up white when the PNGs are 24-bit.
With 32bit, they are transparent and look OK on any background.

So whenever we want to use this 'ripped-edge' feature, we have to be aware of this - i.e., do the screenshot, save it as a file first, then insert the file, using CTRL-P and selection...
Whereas it is always so nice and easy to just paste a clipboard image into the H&M editor... to have it saved with just two clicks!

-> So: Is there any way to make H&M save an inserted clipboard image by default (or by save-options) as a 32-bit PNG graphic (thus enabling transparency)?

Thank you very much for any hints!

Best regards,

Nadja
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Tim Green »

Hi Nadja,

Thanks for pointing this out -- it is something that nobody has ever mentioned before. I will check this with our developers and post back here when I have more information.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Tim Green »

Hi Nadja,

Update: This just wasn't included because nobody had noticed it. We will include 32-bit PNG pasting in the next maintenance update of Help+Manual. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Tim Green »

This new beta build will now paste 32-Bit PNGs as 32-bit instead of 24-bit. It's not an official release version but you're welcome to try it if you like:

https://www.helpandmanual.com/download/ ... p-v821.exe
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Tim,

... WOW. That was speedy! :o :shock:
Thank you and the developers very much for addressing this so quickly!
Sorry that I could not check back earlier. I will gladly try this out ASAP and get back to you!

Thanks a lot, & Best regards
Nadja
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Tim,

have installed the prerelease. Images inserted from the clipboard are now saved by H&M as 32-bit pngs, but alas, they are still not transparent.
I'm not a graphics formats wizard, but could it be there is something called the 'alpha' information missing?
(This is a little detail that is mentioned in the png save options of my image editor, SnagIt. And I have encountered this term before, when searching for general information on how images are being handled in the clipboard. But that does not mean that I'd could tell what it actually is...!)

To clarify, I'll attach two screenshots of the same image. It shows the png 'Save' options of SnagIt, and it has a ripped edge, so displaying these images on a non-white background will show that the one saved using SnagIt is transparent, while the one saved using H&M directly has a white background despite being 32-bit.

Thank you very much!
Best regards,

Nadja
You do not have the required permissions to view the files attached to this post.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Alexander Halser »

The transparent PNG works perfectly fine when copied and inserted via clipboard.
However, it depends on the program that fills the clipboard, what format it puts there.

I wouldn't place my bets on SnagIt. Just because it can save a transparent PNG doesn't mean it places a transparent PNG on the clipboard. And if it doesn't, there is no way to retrieve it.

By the way, if you have it in SnagIt anyway, why not just save it as PNG there? You can drag and drop PNG images from Windows Explorer into the editor of H&M.
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Alexander,

Thank you very much for your reply.
I see you are using paint.net, and obviously this is doing something differently than SnagIt.
Alas, I do not have the option to use paint.net. SnagIt is the "best" I can have on the (customer-owned) PC (and I am already happy that I can keep my favorite older version of it, as the newer ones I find extremely annoying and a big drawback compared to the older ones).
(and Impict does not offer to save pngs as 32-bit at all, and I cannot use the .ipp format due to reasons of company standards and whatnot, etc. ...).

... However, SnagIt *does* copy transparency information to the clipboard. Really. Somehow.
I can copy a transparent image out of SnagIt editor to the clipboard and paste it directly e.g. into Word or other Office applications, and it will keep transparency there.

I have no idea why, and how, and what is the difference to how paint.net does it.
Or, how Word does retrieve it compared to H&M... and so on.
From what I found with Auntie Google's help, I am very much aware that this is overall extremely complicated stuff - how images are written to, and retrieved from, the clipboard. Not very transparent at all, to me (sorry... pun intended, but bad. :oops: )

Concerning your suggestion to save it as a png first, then insert the file to H&M: yes - this is exactly how we currently do it, to avoid any problems.

But the feature to have H&M do the saving is just very nice and convenient, saves time and a few clicks, spares me the additional Explorer window to have always open, and takes perfect care of the file names... but I surely do not need to explain, as I am pretty sure those are reasons why you implemented this function in the first place. :)

Best regards,
Nadja
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Alexander Halser »

Do you have another image editor that can deal with alphatransparent PNGs on the clipboard?
To transfer alpha-images through the clipboard, you need a capable sender and receiver.
I don't have SnagIt installed, so I cannot test this.
... However, SnagIt *does* copy transparency information to the clipboard. Really. Somehow.
Just within SnagIt? Or between other programs as well? If transparency works just within SnagIt, that's no proof. Try to paste a SnagIt image into MS Word. Does that retain the transparency?
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Alexander,

ehm, you might have overlooked the very next line I wrote after the one you quoted - which was:
I can copy a transparent image out of SnagIt editor to the clipboard and paste it directly e.g. into Word or other Office applications, and it will keep transparency there.
So, no, not just within SnagIt.

Please tell me: How does pasting from paint.net to Word work for you? Can you copy a transparent image from paint.net to clipboard and paste it to Word without losing the transparency?
- Just asking, because, in the meantime, I have now installed both the H&M patch 8.2.1 and also paint.net (4.2. something, as was available) on my *private* machine, just for curiosity.
And it seems there, that when I insert a picture with transparency, copied out of paint.net to clipboard and pasted into Word, it *loses* transparency.
Whereas copied from SnagIt to Word, it will keep transparency.

Seems like attaching a real Word file here is not allowed! - So I attach two screenshots of Word (on my private machine) instead:
- one showing an image copied-and-pasted from Snagit to Word, into a textbox with gray background.
(The transparency, again, is between the ripped edges and the actual file dimensions. As you can see, no white in there - so this works.)
- The other one shows an image copied-and-pasted from paint.net in a Word textbox with green background. -> White on the edges, not transparent.

So maybe paint.net and SnagIt are doing just the opposite things each... !

-> Summary:
- Using paint.net to edit the image, then copy it to clipboard, then pasting it to H&M, DOES keep transparency.
Pasting the same to Word does NOT (for me, on private PC - cannot test this on Work device).
- Using SnagIt to edit the image, then copy it to clipboard, then pasting it to H&M does NOT keep transparency.
But pasting the same to Word DOES. (on work PC and also on private PC).

... whoa. Thank you very much for following with this really malicious stuff...!

Best regards,
Nadja
You do not have the required permissions to view the files attached to this post.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Martin Wynne »

Hi Nadja,

Have you considered making the "ragged edge" screenshot using the same background colour as your web page? Then it doesn't need to be transparent and you can use any image format. Including from Impict for easy editing in H&M.

Martin.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Alexander Halser »

Hi Nadja,

You are correct, I missed that part with MS Word. :oops:

Ok. SnagIt demo installed, let's examine the beast. For the record, SnagIt does not place a transparent bitmap on the clipboard. A paste operation from SnagIt to Paint.Net results in a non-transparent image.

snagit_to_paintNet.jpg


What SnagIt does instead, is: it saves the image as a temporary transparent PNG file on disk, then puts a piece of HTML code onto the clipboard which refers to the temporary file. It would have been nice by the Techsmith programmers if they had put the PNG onto the clipboard as well (I mean they create the PNG anyway, that would have been just an extra 3 lines of code).

Code: Select all

<HTML>
<BODY>
<!--StartFragment--><img border="0" src="file:///C:/Users/ALEXAN~1/AppData/Local/Temp/SNAGHTML5aea6a.PNG" width="384" height="350"><!--EndFragment-->
</BODY>
</HTML>
The HTML code is side-by-side on the clipboard with the non-transparent bitmap. MS Word obviously prefers the HTML code and pastes that. Help+Manual prefers the image.

Help+Manual has an option to deliberately paste HTML code from clipboard (if available). However, it does not (or did not) prefer HTML over a clipboard image, so the image always takes (or took) preference. We have changed this now.

Please download the new build here:
https://www.helpandmanual.com/download/ ... p-v821.exe

When you just press CTRL+V, it will perform a standard paste operation, iterating through clipboard formats as it normally does. A picture on the clipboard takes preference over any HTML fragment. However, if you explicitly select "Paste HTML", this reverses the preferences and Help+Manual will paste HTML code instead of an image. In case of SnagIt, this HTML code includes a link to a transparent PNG which is being inserted and copied without further confirmation. SnagIt decided how to name the image.

hm821_paste_html.png
You do not have the required permissions to view the files attached to this post.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Alexander,

sorry for the delay, I did not get to trying it out all week, due to some other line of work not involving H&M. Done now.

Thank you for your disassembling "The Beast" so thoroughly! I never had the slightest idea what actually gets written to the clipboard, and would not have suspected that HTML was involved there in any way.

So this means that using RMB > Paste > Paste HTML would have worked all the time!
(And it does - I tried it out before installing the new build, on both machines, and also on an 'old' H&M 7: Works everywhere)
:shock:
Whoa... Da muss man erst mal draufkommen!! (Apologies to non-German speaking readers. Exclamation of astonishment which does not translate well.)

:?: -> But now, with the new build you linked to (.5670) installed, I cannot detect any difference -- ? :?:
CTRL-V still pastes a non-transparent image, and Paste > HTML still works, as above (on both machines.)

At this point, I am not quite sure if I understand your explanation correctly:
However, it does not (or did not) prefer HTML over a clipboard image, so the image always takes (or took) preference. We have changed this now.
suggests to me that the default inserting behavior should be different with the new build,
but the next paragraph
When you just press CTRL+V, it will perform a standard paste operation, (...)
seems to describe the behavior before ... - or, does it?

Did I miss, or misunderstand, something here?
Thank you again for your patience with me... :oops:

Best regards,

Nadja
User avatar
Nadja211
Posts: 15
Joined: Tue Sep 08, 2020 4:45 pm

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Nadja211 »

Hello Martin,

Thank you for your suggestion!
This would indeed be a simple solution - if the picture was used on one background only.

Of course, many of the non-transparent screenshots are not noticeable, because the default background is white, too.
But we use some shades of grey (not fifty, just two or three...) as background colors in drop-down toggles. These drop-down toggles are sometimes nested. The idea is: the deeper the nesting, the darker the grey. To give users an optical hint where they are and how deep they did expand.
So, an image with a defined background color "Grey-1" would stand out when it appears on the regular text body (white), or also in a nesting with a background of "Grey-2".

All contents of those toggles are stored as use cases in a separate project, and used in multiple contexts in different projects.
So we cannot predict on which backgrounds a topic with a specific image will be used - they may be used in all contexts (which is just the point of having a separate use case project; only having to edit in one single place if something changes), and thus need to work with all backgrounds.

(Example, to illustrate: There is a use case for "How to create a new object". In the main topic dealing with creation of objects, the instructions of course are in the white main text body.
But many other tasks, which are described in other topics, just *involve* creating a new object at some point. So we have to refer to it there too.
We chose to use expandable toggles with linked snippets, rather than plain links, on principle for such cases - because opening a link always disturbs the reading flow.
With toggles, the user can decide while reading if they want to see more details, or leave the toggle closed if they already know ho to create an object. And when they open the toggle, the grey background indicates to them that this part now is a "deeper excursion" from the main text.)

Thank you, and have a nice new week!

Best regards

Nadja
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Graphics inserting: 24-bit only for PNGs?

Unread post by Alexander Halser »

seems to describe the behavior before ... - or, does it?
Almost, yes. It is correct, that in HM7 the "Paste HTML" function did work with SnagIt. The standard Paste function with CTRL+V, however, has changed over the versions. When tested, I tested the latest beta version before the release of 8.2.1. Here, the picture version took absolute precedence over the HTML version. The "Paste HTML" function actually calls the same paste operation with different parameters, so that "HTML" takes precedence over anything else. But if there is no actual HTML on the clipboard, the fallback iteration for alternative clipboard formats is still in place.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply