-1

If I have an image that at normal resolution (72dpi) is 50x50, and I need to make a 2x resolution image for retina display, do I make it...

  • 50x50 at 144 dpi?
  • 100x100 at 144 dpi?
  • 100x100 at 72 dpi?

I need to appear the same size. In other words, it can't look twice as large on a retina screen. (I'm new to this.)

Casey Crookston
  • 13,016
  • 24
  • 107
  • 193

1 Answers1

0

There's no such thing as "dpi" in UIImage display. Just make the 2x version 100x100, twice the point count as the 1x version.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Ok. And then it will display at half the size? – Casey Crookston Mar 22 '17 at 01:40
  • It will display as 50x50 _points_, because it will be a 100x100 _pixel_ image on a double-resolution screen, that is, a screen with two pixels per point. See my explanation here: http://stackoverflow.com/questions/42797719/image-asset-size-in-xcode-interface-builder/42798062#42798062 – matt Mar 22 '17 at 01:40
  • If you're looking for a simple way to resize images from a command line utility, I've found ImageMagick very handy. http://www.imagemagick.org/script/index.php You can install it via Homebrew https://brew.sh – Adrian Mar 22 '17 at 01:43
  • @Adrian He shouldn't resize a 50x50 to 100x100 to serve as the 2x image. It will look terrible. – matt Mar 22 '17 at 01:45
  • @matt Right. Scale down the big image, not scale up the small. – Adrian Mar 22 '17 at 01:52