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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:35:53+00:00 2026-05-12T20:35:53+00:00

Imagine you have two images A and B, and a third grayscale image T.

  • 0

Imagine you have two images A and B, and a third grayscale image T. A and B contain just about anything, but let’s assume they’re two scenes from a game.

Now, assume that T contains a diamond gradient. Being grayscale, it goes from black on the outside to white on the inside.

Over time, let’s assume 256 not further elaborated on “ticks” to match the grayscales, A should transition into B giving a diamond-wipe effect. If T instead contained a grid of smaller rectangular gradients, it would be like each part of the image by itself did a rectangular wipe.

You might recognize this concept if you’ve ever worked with RPG Maker or most visual novel engines.

The question ofcourse is how this is done. I know it involves per-pixel blending between A and B, but that’s all I got.

For added bonus, what about soft edges?

And now, the conclusion

Final experiment, based on eJames’s code

Sample from final experiment — waves up, 50% http://helmet.kafuka.org/TransitionsSample.png

  • 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-12T20:35:54+00:00Added an answer on May 12, 2026 at 8:35 pm

    The grayscale values in the T image represent time offsets. Your wipe effect would work essentially as follows, on a per-pixel basis:

    for (timeIndex from 0 to 255)
    {
        for (each pixel)
        {
            if (timeIndex < T.valueOf[pixel])
            {
                compositeImage.colorOf[pixel] = A.colorOf[pixel];
            }
            else
            {
                compositeImage.colorOf[pixel] = B.colorOf[pixel];
            }
        }
    }
    

    To illustrate, imagine what happens at several values of timeIndex:

    1. timeIndex == 0 (0%): This is the very start of the transition. At this point, most of the pixels in the composite image will be those of image A, except where the corresponding pixel in T is completely black. In those cases, the composite image pixels will be those of image B.

    2. timeIndex == 63 (25%): At this point, more of the pixels from image B have made it into the composite image. Every pixel at which the value of T is less than 25% white will be taken from image B, and the rest will still be image A.

    3. timeIndex == 255 (100%): At this point, every pixel in T will negate the conditional, so all of the pixels in the composite image will be those of image B.

    In order to “smooth out” the transition, you could do the following:

    for (timeIndex from 0 to (255 + fadeTime))
    {
        for (each pixel)
        {
            blendingRatio = edgeFunction(timeIndex, T.valueOf[pixel], fadeTime);
            compositeImage.colorOf[pixel] =
                        (1.0 - blendingRatio) * A.colorOf[pixel] + 
                        blendingRatio * B.colorOf[pixel];
        }
    }
    

    The choice of edgeFunction is up to you. This one produces a linear transition from A to B:

    float edgeFunction(value, threshold, duration)
    {
        if (value < threshold) { return 0.0; }
        if (value >= (threshold + duration)) { return 1.0; }
    
        // simple linear transition:
        return (value - threshold)/duration;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two images, both with alpha channels. I want to put one image
Let's imagine that we have two arrays: $array_1 = array( '0' => 'zero', '1'
Imagine I have the two dimensional image of a hotdog. I can draw a
Let's imagine I have two threads which execute some database-oriented code in thread-specific TransactionScopes
Imagine I have two byte[] arrays, b1 and b2, and they have the bytes
Imagine we have two tables in the database, user (FK id_role) and role (PK
Imagine I have two protocols: @protocol A @end and @protocol B <A> // Protocol
Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Imagine I have two (three, four, whatever) tasks that have to run in parallel.
Imagine that we have two tables as follows: Trades ( TradeRef INT NOT NULL,

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.