usbview icon indicating copy to clipboard operation
usbview copied to clipboard

Icons: Make PNG/XPM transparent, hi-res

Open ferdnyc opened this issue 1 year ago • 5 comments

Extend the ImageMagick convert commands for generating icon bitmaps:

  • Add -background none, to render with background transparency.
  • Add -density 300x300, to render larger sizes at full resolution.

Because the SVG's internal coordinate system is only sized for 64x64 pixels, ImageMagick will render at that size and then scale the bitmap up, when outputting larger image sizes. Increasing the DPI using -density allows it to upscale the SVG vectors at full resolution.

Comparison: 256x256 usbview.png from this branch vs. master, atop solid red

usbview-icon-compare

ferdnyc avatar May 22 '24 09:05 ferdnyc

(Yes, the need to specify either/both of these explicitly ranks among the more stupid and inexplicable of ImageMagick's... "endearing quirks".)

ferdnyc avatar May 22 '24 09:05 ferdnyc

I added an additional -density flag to reset the icon bitmaps' intrinsic DPI to 96 before output, so that the 256-pixel icons don't get stored as 300 DPI 0.85 inch × 0.85 inch images. (Metadata matters!)

ferdnyc avatar May 22 '24 09:05 ferdnyc

@gregkh Ping? I'm sure usbview is relatively low-priority, and there's certainly no real urgency to this. Just wanted to call your attention to it, if you hadn't seen. Thanks!

ferdnyc avatar May 24 '24 10:05 ferdnyc

On Fri, May 24, 2024 at 03:17:47AM -0700, Frank Dana wrote:

@gregkh Ping? I'm sure usbview is relatively low-priority, and there's certainly no real urgency to this. Just wanted to call your attention to it, if you hadn't seen. Thanks!

I see it, thanks, will be a few weeks before I get back to usbview changes!

greg k-h

gregkh avatar May 24 '24 11:05 gregkh

Weird... I had a new notification for this PR, but I can't for the life of me figure out why. Nothing's changed, that I can see.

ferdnyc avatar Jul 29 '24 08:07 ferdnyc

Sorry for the delay, thanks for doing this!

gregkh avatar Nov 10 '24 14:11 gregkh