Results 1 to 4 of 4

Thread: Graphics, blending pictures.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2017
    Posts
    26

    Graphics, blending pictures.

    This is one for all you graphics people.

    I need to come up with a way to create a fade effect (multiple pictures) from a starting image to an end image. I've written some pixel by pixel routines using tray maps for general fades and they work well. However the next project is a bit more complicated.

    Just as an example, because it's easy to imagine: I have two pictures of a moving car, the background is static and the car is around 20 feet away. In the first picture the car is on the left of the image, in the second the car has moved a few feet to the right.

    I now need to create 24 frames of the car blending from the first location to the last. It's not so important what happens to the background, it could simply blend, but I have to create a kind of car like ghost moving from the first to last point. It doesn't have to be pixel for pixel, it could be a ghostly effect, or speckle like, the most important thing is to create a sense of movement.

    I have cases where I need to do this with chess pieces on a board, random items on a table in different places, all sorts of different scenarios.

    Where my knowledge lets me down is how to identify the similar areas of the pictures. I don't want to draw around objects, there are no end of images, so it has to be automatic.

    Does anyone have any ideas or routines that would identify the 'car' or the similar regions in two pictures?

    If anyone can suggest any existing software that will do this please let me know.

    Many thanks.

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Graphics, blending pictures.

    I would think you would just use a color matrix with a particular alpha level, depending on how faded you want the image to be, and then just use DrawImage to draw your car image on your background using that color matrix. That is assuming the image to be drawn does have 0 alpha already in the places that are not part of the object, i.e. a png file or gif file, that supports transparency.

    If you wanted the car to be fairly clear, but leave a fading trail as it moves, perhaps different approach would be to draw a faded image (low alpha) of the background over the car each pass, so as the car moves, it is fairly distinct where it is, but where it was previously will fade out more and more each update, leaving a fading blur effect behind the vehicle. I haven't tried that with a background image before (the background was just black, so the objects just left a fading trail behind them as they moved), so that might be tricky.
    Last edited by passel; Jun 7th, 2018 at 07:56 AM.

  3. #3
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,372

    Re: Graphics, blending pictures.

    i am not sure if what passel describes is really what you want as i guess the pieces are not always moving from left to right. i rather understand that you have two Pictures where an object moved from Position A to B and you Need to interpolate Images in between for that movement. Thats not an easy Task an i have no easy answer to that but the right keyword for a Google search should be "Motion Interpolation". This is Kind of common in TVs today and done by Hardware in These devices but i guess you can also find a library for the PC doing that. however i would not expect great Quality when you interpolate so many (24) Frames.

  4. #4
    Hyperactive Member
    Join Date
    Apr 2011
    Location
    England
    Posts
    421

    Re: Graphics, blending pictures.

    No idea if this will work but just a quick thought based on something vaguely related that I worked on several years ago..

    Can u scale both images to an equal size, convert both to black & white pixels and then do an Xor merger of the two images to cancel out all of the matching pixels. Whatever densely pixelated areas are left over should be the outline of the two shapes which should make it easier to plot the start location, trajectory and end location.

    Then you should be able to map both areas of interest from the original images over one another, move them along the path and fade the top image out to get the desired effect.

    This is assuming the backgrounds of the images arent likely to be too different.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width