xcode shrinking images

Discussion in 'iOS Programming' started by liptonlover, Oct 26, 2008.

  1. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #1
    I'm putting images into my xcode project, and it's choosing to shrink some of them drastically, well past a usable point. It's not doing it to all of them, it's not just doing it to big ones, and it's not just doing it to small images. Deleting the image and then putting it back in doesn't fix it. How do I stop this from happening?
     
  2. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #2
    Wait a second here, when browsing in the resources is your image shrunken, or is it shrunken when displayed on the XIB? The latter is just some settings you need to adjust. The images might be "shrunken" to fit in the resource preview, but they aren't actually reduced in size.

    We need some more details here :)
     
  3. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #3
    In xcode, when I select the shrunken ones from the list, the preview is very small. When I go to the media library in IB, the preview there is the same size as all the other previews, just extremely pixelated to an unrecognizable point. When I drag one around but not onto the window yet, it's a bigger pixelated picture than the preview. When I drop it onto a window, I get an image approximately 50x20, not pixelated but waaaaaaaay too small. The object also has a lot of blank opaque space around the image, within the object bounds. The mode is set to center by default, doing any mode that makes it bigger means getting the extremely pixelated image again. It's not just showing a shrunk version, it seems to actually be shrinking the image, except that going to the image in finder, it's still the original size.
    Nate
     
  4. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #4
    no one can help? This isnt' happening to anyone else?
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Please don't bump threads, it's not only very rude but it's also against the forum rules.

    The only thing I can think to suggest is to check the DPI settings within the images. XCode may well respect this.
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    lipton, I really don't know what you're talking about. Can you post some screenshots or images that have been shrunken?
     
  7. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #7
    @robbie - Sorry wasn't thinking...
    How do I check the dpi?

    @phoney -
    In preview, viewed from finder.
    [​IMG]

    Selected in xcode.
    [​IMG]

    Selected in IB.
    [​IMG]

    Dragged onto a view in IB.
    [​IMG]
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    I think it's available under Get Info in Preview.
     
  9. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #9
    Haven't seen this. Robbie is right, if the image is 300 dpi that might explain this. You can certainly view the dpi in Photoshop.

    I don't have any images as large as this in my projects. I added a screen shot jpeg of about 1100 x 600 to a test project. When I view it in Xcode or in IB in an image view it shows as full size. In IB in the media view in the Library window it is scaled down to fit the size of the space. This is different from what you're seeing.
     
  10. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #10
    Ok, the two images currently in my project that are doing this have a dpi of 300. (Well, one is .3 below) How can I change this? Preferably, how is it avoided in the first place, even more preferably in gimp. Otherwise, I have photoshop at my disposal. Thanks so much guys.
    Nate
     
  11. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #11
    I don't know about gimp, although I'm sure it can do this.

    In PS open the image and choose Image -> Image Size. Change the resolution there from 300 to 72 pixels per inch. You'll probably also have to change the height and width to the size you want. It should also Resample Image, which will smooth the resulting image.

    I guess your image was scanned. When you scanned it you chose the resolution. I would say it's normal to scan at a higher resolution and then later adjust the resolution for your needs. If you scan at 72 dpi then you may have quality problems if you do need to resize it very much.
     

Share This Page