How do you optimize a JPEG image for MSI installer

2019-09-16 15:54发布

问题:

I am dealing with a splash screen logo and I've noticed that on different OS versions this image gets distorted, but it happens to work when dealing with Windows 8.1, but not on Windows 7 or Vista. I've been using Adobe Fireworks in conjunction with Illustrator to generate it, and I must have tried a ton of different settings but I can't get the same experience across all operating systems.

I load it into my WiX project as follows:

<Binary Id="SplashBinary" SourceFile="Splash.jpg"/>

And I use it like so:

<Control Id="SplashBitmap" Type="Bitmap" X="0" Y="0" Width="373" Height="252" Text="SplashBinary" TabSkip="yes" Sunken="no" Disabled="yes" />

I've tried using the width and height above but it would not look good on 8.1 (too blurry), so I doubled it on the image to get a crisper result in Windows 8.1 (its perfect in 8.1). But again, it looks like its aliasing is messed up on 7 and Vista. Can anyone shed some light as to what I need to do to get a consistent experience? What do I need to do to my image to export it such that it renders a nice crisp result on these platforms?

回答1:

I got it to work by scaling my image up by an exact factor of 1.3333333333 (I got this idea from this question):

[ Width  ] -> 373 * 1.3333333333 = 497.3333333209
[ Height ] -> 252 * 1.3333333333 = 335.9999999916

This is the stupidest thing I've ever had to do. I don't know why this is the case. However, it now looks fantastic on all operating systems. I'm so displeased by this being a necessary step. PS: I also have my image at a resolution of 300 PPI.