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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:26:01+00:00 2026-05-30T01:26:01+00:00

I have a little problem with my pixellation image processing algorithm. I load the

  • 0

I have a little problem with my pixellation image processing algorithm.

I load the image from the beginning into an array of type unsigned char*
After that, when needed, I modify this data and have to update the image.
This updating takes too long. This is how I am doing it:

CGDataProviderRef dataProvider = CGProviderCrateWithData(.....);
CGImageRef cgImage = CGImageCreate(....);
[imageView setImage:[UIImage imageWithCGImage:cgImage]]];

Everything is working but it’s very slow to process a large image. I tried running this on a background thread, but that didn’t help.

So basically, this takes too long. Does anyone have any idea how to improve it?

  • 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-30T01:26:02+00:00Added an answer on May 30, 2026 at 1:26 am

    As others have suggested, you’ll want to offload this work from the CPU to the GPU in order to have any kind of decent processing performance on these mobile devices.

    To that end, I’ve created an open source framework for iOS called GPUImage that makes it relatively simple to do this kind of accelerated image processing. It does require OpenGL ES 2.0 support, but every iOS device sold for the last couple of years has this (stats show something like 97% of all iOS devices in the field do).

    As part of that framework, one of the initial filters I’ve bundled is a pixellation one. The SimpleVideoFilter sample application shows how to use this, with a slider that controls the pixel width in the processed image:

    Screenshot of pixellation filter application

    This filter is the result of a fragment shader with the following GLSL code:

     varying highp vec2 textureCoordinate;
     uniform sampler2D inputImageTexture;
     uniform highp fractionalWidthOfPixel;
    
     void main()
     {
        highp vec2 sampleDivisor = vec2(fractionalWidthOfPixel);
    
        highp vec2 samplePos = textureCoordinate - mod(textureCoordinate, sampleDivisor);
        gl_FragColor = texture2D(inputImageTexture, samplePos );
     }
    

    In my benchmarks, GPU-based filters like this perform 6-24X faster than equivalent CPU-bound processing routines for images and video on iOS. The above-linked framework should be reasonably easy to incorporate in an application, and the source code is freely available for you to customize however you see fit.

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

Sidebar

Related Questions

I have a little problem with converting a char string array to an unsigned
I have a little problem with a Listview. I can load it with listview
I have a little problem, I have an array and I want to add
I have a little problem, I am building a database from CSV files using
I have a little problem with multiline UILabel, my UILabel text like starts from
I have a little problem with my function: function swear_filter($string){ $search = array( 'bad-word',
I'm have little problem in retrieving the data from a table here's the code:
i have little problem with boost::asio library. My app receive and process data asynchronously,
I have a little problem with a simple vbScript. The script has to run
I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,

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.