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 8311059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:41:13+00:00 2026-06-08T19:41:13+00:00

I have following question: How can I scan a complete image to get for

  • 0

I have following question: How can I scan a complete image to get for every pixel it’s color.

I use this library https://github.com/unixpickle/ANImageBitmapRep.

I have this code:

- (void)executeImageScanProcessWithImage:(UIImage *)image{


dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 
                                         (unsigned long)NULL), ^(void) {


    NSString *rowString = @"";
    NSMutableArray *array = [[NSMutableArray alloc] init];
    ANImageBitmapRep *imageBitmap;
    UIColor *color;
    // Loop für die Spalten (y)
    for (int y = 0; y < 320; y += 20) {
        rowString = @""; // rowString zurücksetzen

        // Loop für die Reihe (x)
        for (int x = 0; x < image.size.width; x += 20) {

            BMPoint pixelPoint = BMPointMake(x, y);
            imageBitmap = [ANImageBitmapRep imageBitmapRepWithImage:image];
            BMPixel pixel = [imageBitmap getPixelAtPoint:pixelPoint];
            color = UIColorFromBMPixel(pixel);

            if ([color isEqual:[UIColor redColor]]) {
                rowString = [rowString stringByAppendingFormat:@"0"];
            }
            else {
                rowString = [rowString stringByAppendingFormat:@"1"];
            }

            // Wenn der letzte "Run" vollzogen ist, wird die rowString in den Array hinzugefügt
            if ([rowString length] == image.size.width / 20) {
                [array addObject:rowString];
            }
        }

        [array addObject:rowString];
    }

    NSLog(@"content of array = %@",array);


});

}

The Problem is that I get this error, when the image gets too big.

Malloc failed which is too bad. I was hoping to use this memory. Jul
24 18:31:41 Christians-MacBook-Pro.local Bitmap_Test[2374] :
CGBitmapContextGetData: invalid context 0x0 Jul 24 18:31:41
Christians-MacBook-Pro.local Bitmap_Test[2374] :
CGBitmapContextCreateImage: invalid context 0x0 Jul 24 18:31:41
Christians-MacBook-Pro.local Bitmap_Test[2374] :
CGBitmapContextGetWidth: invalid context 0x0
Bitmap_Test(2374,0xb0103000) malloc: * mmap(size=2265088) failed
(error code=12)

Do you know another approach to deal with this plan?

Best regards from Germany,
Chris

  • 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-06-08T19:41:15+00:00Added an answer on June 8, 2026 at 7:41 pm

    I found another thread’s code, which i replaced with my code.

    Here is the thread:
    How to get pixel data from a UIImage (Cocoa Touch) or CGImage (Core Graphics)?

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

Sidebar

Related Questions

I have following question on adobe omniture How we can register an iPhone app
I have the following question about JPA: Can I save the order of the
I have the following question. How can I print an output file line by
I have a question, although I can't really go into specifics. Will the following
The following question can either be solved by probably changing my use of the
I have the following question regarding Flex/AIR data grids: Can I access the value
I have the following question. Premises for this question are the following. I want
I have following question. I DO THIS: @inquiry = Survey::Inquiry.find(:all, :conditions => [respondent_id =
I have a following question. We use log4j in our two projects, that are
I have the following question - I need that my user can't see my

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.