Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 383839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:19:22+00:00 2026-05-12T15:19:22+00:00

I have a UIImage that is being filled with the image coming from the

  • 0

I have a UIImage that is being filled with the image coming from the iPhone camera.

As the image has 2048×1536 pixels, it consumes a big chunk of memory.

  1. I hope this image is 24 bits, rather than 32 bits, but I am not sure. So this is the first question. Is the image coming from the iPhone camera 24 or 32 bits?
  2. The second question is: if the image is 32 bits, how can I make it 24 bits to same memory?
  3. The third question is: is there anything I can do to this image, WITHOUT CHANGING ITS SIZE, before assigning it to a variable to save space?

No solution involving OpenGL, please.

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:19:22+00:00Added an answer on May 12, 2026 at 3:19 pm

    There’s not a whole lot you can do without having that picture in memory and creating a second buffer to store the modified version. I believe that second buffer could contain fewer bits per color, and even skipping the alpha value. If you go with 4bits per color, you’d be able to shave off 50% off the original, and that’s not including the savings if you got rid of the alpha.

    A set of simple calls will tell you what the info on the picture is, such as bits per color and whether it has alpha included:

    CGImageAlphaInfo CGImageGetAlphaInfo (
       CGImageRef image
    );
    

    Return Value
    A CGImageAlphaInfo constant that specifies (1) whether the bitmap contains an alpha channel, (2) where the alpha bits are located in the image data, and (3) whether the alpha value is premultiplied. For possible values, see “Constants.” The function returns kCGImageAlphaNone if the image parameter refers to an image mask.

    size_t CGImageGetBitsPerComponent (
       CGImageRef image
    );
    

    Return Value
    The number of bits used in memory for each color component of the specified bitmap image (or image mask). Possible values are 1, 2, 4, or 8. For example, for a 16-bit RGB(A) colorspace, the function would return a value of 4 bits per color component.

    size_t CGImageGetBitsPerPixel (
       CGImageRef image
    );
    

    Return Value
    The number of bits used in memory for each pixel of the specified bitmap image (or image mask).

    This should get you started on seeing what the image is composed of. To recreate it in fewer bits, is a bit more work, and temporarily requires more memory, until after you can discard the original image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display an image that is being retrieved from core data and
I have a UIImage containing an image with a whole bunch of smaller pictures
I have one app, a UIImage* . I'm painting the image twice: Once in
Root view is a UIImage View, it has subviews, those have subviews. My root
the image that is being displayed in this code is leaking but I cant
I have a UIViewController called LaunchController that is launched in my iPhone app when
I have a project that is coming around the bend this summer that is
I have code that will check to see if an image is on the
- (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize { // If the image does not have an alpha
I have a View based application for iPhone/iPod that plays audio, having a VU

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.