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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:16:32+00:00 2026-06-14T18:16:32+00:00

this is my first time asking question in stackoverflow. I tried hard not to

  • 0

this is my first time asking question in stackoverflow. I tried hard not to make any guideline violations, but let me know if there is any—please understand since it is my first time.

I have a code in Mathematica, and I think it is REALLY slow.

I have a stack of images—couple hundreds, and I was creating a simple algorithm in Mathematica to combine images into a single image by averaging pixel data across the entire stack.

For example, assume that I have a pixel at 520 x 23, and I want to get all the number(data) from every single images in the stack and average that table. I want to repeat this process for every single pixel in my image. Then, I will be able to reconstruct the data into an image using Image[]. For the testing, I used 1024 by 1024 image, but I want to use 8000 by 8000 eventually.

Here is my code:

idlist = Map[ImageData, ilist];
Table[Table[Map[Mean,Transpose[Table[idlist[[a,b,c]],{a,1,Length[idlist]}]]],{b,1,1024}], {c, 1, 1024}]

I found out that my nested Table was faster than using a single Table for some weird reasons.

1.How should I optimize this?
2.Is there a benefit using any parallel computing for this specific implementation?

  • 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-14T18:16:34+00:00Added an answer on June 14, 2026 at 6:16 pm

    I’m not sure if I’m following your coding, but to get the mean pixel value for a bunch of images, you could simply do the following (it’s fast):

    imDim = 100;
    n = 80;(*number of images*)
    (*generate random image list*)
    ilist = Array[RandomImage[1, {imDim, imDim}, ColorSpace -> "RGB"] &, n];
    (*take mean*)
    Image@Mean[ImageData /@ ilist]
    

    Mathematica graphics

    For a large collection of random images it should converge to homogeneous gray (RGB[.5,.5,.5]). Let’s test it:

    imDim = 3;
    n = 2000;(*number of images*)
    (*generate random image list*)
    ilist =  Array[RandomImage[1, {imDim, imDim}, ColorSpace -> "RGB"] &, n];
    (*take mean*)
    Image@Mean[ImageData /@ ilist]
    

    Mathematica graphics

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

Sidebar

Related Questions

Well this is not the first time im asking these question here but I
this is my first time asking a question on stackoverflow. I'm working on a
this is my first time asking a question here. I tried to be well
This is my first time asking my question at stackoverflow. I'm working on a
I am first time asking question here, sorry, but I can not find similar
This is my first time asking a question on Stackoverflow. I can't get a
I already tried asking this question at Relative layout Coding , but that first
This is my first time asking a question on StackOverflow, so I apologize in
this is my first time asking a question so bear with me. I am
I am new to Python and this is my first time asking a stackOverflow

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.