How to prevent WebHelp from downconverting images

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

How to prevent WebHelp from downconverting images

Unread postby mmccullo » Fri Mar 23, 2018 10:11 pm

I work on a 4K screen and save my screenshots as 192 DPI images (200% scaling) in PNG format. These display fine in the H&M editor and I specify a scaling factor to size them appropriately.

When I run WebHelp, it wants to convert all images to 96 DPI at the scaled size. This results in the scaled images appearing very blurred on 4K screens. When I replace the image in the output folder with the original, the relative size is unchanged on the HTML page (the sizing is specified in em units in the HTML output), but the resolution is much improved (i.e. the blurriness is gone).

How do I prevent WebHelp from down-converting my original images? I don't see why that conversion is necessary as the scaling is specified in a resolution-independent manner that works with modern browsers.
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Fri Mar 23, 2018 10:41 pm

Hi,

192 DPI (dots per inch) is meaningless unless you are intending to print your images on paper in the real world. Display screens are sized in pixels, not inches. DPI screen values are used in order to scale fonts, not images -- fonts are typically sized in Point sizes (1 pt = 1/72nd inch), so a DPI conversion factor is needed to scale them for the dots on the screen.

I suggest you create your images at the actual pixel sizes required, and then insert them in H&M using the 99.90% scaling factor (which is H&M code for shrinking them to fit the device, but never enlarge them beyond the actual pixel size).

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Fri Mar 23, 2018 11:23 pm

Ok since you didn't like the way I phrased it...

I want WebHelp to export my image unchanged from the captured pixel dimensions with a scaling factor other than 100%. Why do I have to specify the scaling as 100% (or 99.90%) when modern browsers can scale down large images just fine and use the extra pixels on HiDPI displays to increase sharpness?
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Fri Mar 23, 2018 11:59 pm

mmccullo wrote:I want WebHelp to export my image unchanged from the captured pixel dimensions with a scaling factor other than 100%. Why do I have to specify the scaling as 100% (or 99.90%) when modern browsers can scale down large images just fine and use the extra pixels on HiDPI displays to increase sharpness?

Hi,

Don't use 100%, use the 99.90% option:

hm_99p90.png

You will then get what you want. If you create an image 2000 pixels wide it will be displayed 2000 pixels wide with the original sharpness on widescreen monitors, and scaled down when viewed on smaller monitors.

It won't actually be displayed at 99.90%. That's just a code number in H&M to set the CSS max-width to the actual size.

The DPI setting in the image file is irrelevant and ignored by browsers.

cheers,

Martin.
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Sat Mar 24, 2018 10:50 pm

But that is not what I want at all. I will try to explain again. I do my image captures at 200% Win 10 scaling on a 4K monitor. That means the relative physical sizing of elements on-screen is identical to a same-sized monitor running at 100% at 1920 x 1080 resolution.

So when i do a screen capture, a window that looks the same size as a 800 x 600 at a 100% scale is actually captured as 1600 x 1200 pixels at 200% scale. When I import the image into the H&M editor, I simply scale it to 50% of its original size, and all the pixels are shown at 200% scale for excellent image sharpness plus the correct relative image size that is equivalent to the physical size on the screen.

I use the em units per the H&M manual to get proper 4K support for the fonts and such. However, when I export my images to WebHelp, H&M insists on cutting the image size in half for images scaled to 50% in the editor. I simply want the image left as it was captured because the em units scaling specified in the HTML allows modern browsers to render the extra pixels on HiDPI displays. I know the exported HTML supports this because if I simply copy the original image (with the new name created by the WebHelp export step) the displayed web page shows twice the detail in the rendered image at exactly the same physical size on-screen.

The method you describe does not work. It results in the images rendered twice their original physical size as shown on the 200% scaled screen.

I want my 50% scaled images in the H&M editor unchanged when exported to WebHelp. Is there any way to do this? Yes, I can copy the images manually after the export, but I have to rename them all to whatever H&M decides to call them and I have to do so every time I re-export the project. I'd rather have H&M do what I need instead of creating extra steps.
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Sat Mar 24, 2018 11:25 pm

mmccullo wrote:But that is not what I want at all. I will try to explain again. I do my image captures at 200% Win 10 scaling on a 4K monitor

Hi,

I don't think that is making much sense. You mean you are using a setting of 200% in the Windows Display Properties, i.e. 192 DPI for font conversions? I'm also using a 4K monitor, but I use a Windows DPI setting of 120 DPI (125%).

However, that setting has no effect on the capture of screen images, it refers only to fonts. If I capture an image displayed 1280 pixels wide on the screen, it is an image 1280 pixels wide. If I want it to appear sharp in my webhelp I must insert it at 100% in H&M.

If you are capturing screenshots from an application, I strongly recommend that you set the application to run DPI-aware, otherwise on a 4K monitor you will always be capturing the larger fuzzy virtual-scaled version.

To do that, right-click on the exe file or its shortcut to get the Properties, and then tick this box (scroll image down) :

compat_dpi_aware.png

The application will then run smaller, but sharp. You can then make screenshots at actual size from it and insert them at the 99.90% setting in you H&M webhelp, and they will stay sharp at all sizes on screens wider than the image. And shrink down on smaller screens/mobile devices.

regards,

Martin.
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Sun Mar 25, 2018 1:59 am

If I want to scale an imported image in the H&M editor, I don't want the WebHelp export to change the original pixel count for ANY given scaling, not just 99.90%. Let the browser image rendering take care of that on the local display, whatever the DPI or scaling or whatever you want to call it.

Right now, if I import a 1600 x 1200 image and set the scaling to 50%, WebHelp converts and saves a new image with 800 x 600 pixels and thereby loses detail -- most noticeably on HiDPI displays. Try it!
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Sun Mar 25, 2018 2:29 am

mmccullo wrote:Right now, if I import a 1600 x 1200 image and set the scaling to 50%, WebHelp converts and saves a new image with 800 x 600 pixels

Hi,

If you set the scaling to 50% in H&M that is exactly what you are asking H&M to do -- resize your supplied image to half of its original size. I don't understand why you are complaining about that. If you don't want it to happen, don't set 50%, insert it at 100% size instead.

If you want an image to appear at 800x600 pixels without loss of detail, you need to capture it at 800x600 and insert it at 100%.

The best way to capture such images from an application on a 4K screen is to set the application to run DPI-aware as I explained. The application will then draw its windows at the smaller size with sharp detail. Then you can capture it at that size and insert it at 100%.

Unless you insert images at 100%, you will always either lose detail (if less than 100%), or they will go fuzzy (if more than 100%).

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Sun Mar 25, 2018 2:52 am

No, no, no.

See:

http://www.cssplay.co.uk/menu/em_images

Em scaling can scale any pixel count and use the local display density to render more detail when available. By specifying 50% scaling in the H&M editor, I am not asking the WebHelp export to reduce the pixel count!

It appears when I select em units in H&M, it indeed is using em scaling for the image size (look at the generated HTML). However, it incorrectly changes the pixel count of my original image on export.
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Sun Mar 25, 2018 3:04 am

mmccullo wrote:No, no, no.

You are entirely free to do whatever you want. But if you already know, why ask?

The answer to your problem is simple. Don't set 50% in H&M. Set 100%, and let the browser do any scaling needed to fit the screen, according to your chosen CSS settings, em, px, max-width, etc.

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Sun Mar 25, 2018 3:20 am

I've provided an example HTML page that makes it clear you can use higher pixel count images with em scaling and the result is a better (sharper) image on higher pixel density displays because the additional pixels are rendered in the same physical space on screen. Can you not see the difference? Try a 200% or 300% setting on your 4K screen and look at the page link I sent again.

I will say again to the H&M developers: please have the WebHelp export not resize images from their original resolutions when em units are specified in the preferences.
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Sun Mar 25, 2018 3:35 am

mmccullo wrote:I will say again to the H&M developers: please have the WebHelp export not resize images from their original resolutions when em units are specified in the preferences.

Hi,

And I will say again, if you don't want H&M to resize your images, don't set 50% or any size other than 100%. I don't understand why you are setting 50%. Have you actually tried 100%? It won't look right in the H&M editor but it will in the webhelp.

Bear in mind that H&M is not an HTML editor. It also produces output in PDF, Word, print, etc.

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby Simon_Dismore » Sun Mar 25, 2018 4:22 pm

Martin Wynne wrote:
mmccullo wrote:I will say again to the H&M developers: please have the WebHelp export not resize images from their original resolutions when em units are specified in the preferences.

And I will say again, if you don't want H&M to resize your images, don't set 50% or any size other than 100%. I don't understand why you are setting 50%. Have you actually tried 100%? It won't look right in the H&M editor but it will in the webhelp. Bear in mind that H&M is not an HTML editor. It also produces output in PDF, Word, print, etc.

Tim suggested in Help with Images in Output PDF: 'If you want high quality images at all zoom settings in PDF you need to use an image that is a lot larger than its display size and then scale it down in the HM editor. HM exports the full original image to the PDF with a scaling command, and this then leaves you enough "reserve quality" to display with better appearance at larger zoom settings.'

I agree with mmccullo there should be an option to allow the same thing for Webhelp output, i.e. the original png, gif or jpeg image is used with a scaling factor, rather than H&M resampling a file that might have been carefully optimized. The option could be managed from Configuration > Publishing options > Webhelp > HTML Export Options.

I suppose this would give mmccullo the control they need? It would also eliminate the overhead of publishing multiple resampled versions if the same image is used at different scales in a Webhelp project. If Martin still has the Firefox 22 screen dpi issue we discussed a while back, it could help with that, too.
Simon_Dismore
 
Posts: 48
Joined: Thu Jul 13, 2017 2:57 pm

Re: How to prevent WebHelp from downconverting images

Unread postby Martin Wynne » Mon Mar 26, 2018 8:04 am

Simon_Dismore wrote:If Martin still has the Firefox 22 screen dpi issue we discussed a while back, it could help with that, too.

Hi Simon,

5 years on it hasn't gone away. I now have Firefox and Opera permanently set on 80% zoom for all web sites, so that 1px = 1dot on 120dpi screens. However, Edge has 1px = 1dot at 100% zoom on 120dpi.

To get round the problem for my users, my app now displays a test pattern image and then reads back the pixel colours from the screen. Users can then adjust their zoom until they get dot-for-dot rendering on any device or screen.

This is important so that screenshots from such as the NLS historic maps site are a) crisp as originally scanned by NLS, and b) can be scaled properly in CAD from the world coordinates in the URL:

http://maps.nls.uk/geo/explore/#zoom=19 ... rs=170&b=4

They have already been resampled from the OS grid projection onto the georeferenced world coordinates (as you can see from the angled grid lines) so any further degradation is to be avoided.

cheers,

Martin.
User avatar
Martin Wynne
 
Posts: 2364
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: How to prevent WebHelp from downconverting images

Unread postby mmccullo » Mon Mar 26, 2018 2:47 pm

Simon_Dismore wrote:
mmccullo wrote:I will say again to the H&M developers: please have the WebHelp export not resize images from their original resolutions when em units are specified in the preferences.

I agree with mmccullo there should be an option to allow the same thing for Webhelp output, i.e. the original png, gif or jpeg image is used with a scaling factor, rather than H&M resampling a file that might have been carefully optimized. The option could be managed from Configuration > Publishing options > Webhelp > HTML Export Options.


Yes, an option to prevent resampling in that dialog would be most welcome. Otherwise the only workaround I have is to copy over the generated project results with the original images, renamed to match the resampled ones.
mmccullo
 
Posts: 11
Joined: Thu Jan 20, 2005 12:13 am

Next

Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 8 guests

cron