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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:55:26+00:00 2026-05-16T15:55:26+00:00

How do you blend two arrays of pixel data to create one image? with

  • 0

How do you blend two arrays of pixel data to create one image? with the option of using different blending modes?

  • 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-16T15:55:27+00:00Added an answer on May 16, 2026 at 3:55 pm

    Pixastic is a special framework for advanced use of canvas, here are blending examples: http://www.pixastic.com/lib/docs/actions/blend/

    If you would like do this alone, you can extract pixel data from 2 images, blend it with a mathematical equation, and put into a canvas. Here is information how to get and put pixel data from/to canvas:
    http://ajaxian.com/archives/canvas-image-data-optimization-tip


    Update:
    Simple example with alpha blending of 2 images in proportion 50-50.
    (Images borrowed from http://www.pixastic.com/sample/Butterfly.jpg and http://www.pixastic.com/sample/Flower.jpg )

    <img src="Butterfly.jpg" id="img1">
    <img src="Flower.jpg" id="img2">
    <p>Blended image<br><canvas id="canvas"></canvas></p>
    <script>
    window.onload = function () {
        var img1 = document.getElementById('img1');
        var img2 = document.getElementById('img2');
        var canvas = document.getElementById("canvas");
        var context = canvas.getContext("2d");
        var width = img1.width;
        var height = img1.height;
        canvas.width = width;
        canvas.height = height;
    
        var pixels = 4 * width * height;
        context.drawImage(img1, 0, 0);
        var image1 = context.getImageData(0, 0, width, height);
        var imageData1 = image1.data;
        context.drawImage(img2, 0, 0);
        var image2 = context.getImageData(0, 0, width, height);
        var imageData2 = image2.data;
        while (pixels--) {
            imageData1[pixels] = imageData1[pixels] * 0.5 + imageData2[pixels] * 0.5;
        }
        image1.data = imageData1;
        context.putImageData(image1, 0, 0);
    };
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm blending two images in my iPhone app, using the HardLight blend mode of
I'm trying to blend two images together with Android, using a Multiply-like blending mode.
How can I blend two images in additive blending mode with Core Graphics? The
I've two for loops that basically look up in two different arrays (each having
Good Day everyone!! One question.. or two.. Is it possible to use Expression Blend
I have an iPhone app that does image manipulation via blending two UIImage objects
I have two images, one background image (img_back.png) and other is an image (person.jpg),
I'm trying to combine two photos into one image (think a body with a
I am working with Blend and Visual Studio to create Surface content. Pretty much
In expression blend I created a sample data source in visual editor. In case

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.