Results 1 to 7 of 7
  1. #1
    shakeel is offline Member
    Join Date
    Dec 2010
    Posts
    20
    Rep Power
    0

    Default Cross dissolving of 2 images.

    Hi,

    I am trying to merge 2 images using the cross dissolving algorithm. That is, one image fades to the other and vice versa.

    Does anyone has an idea how to do this? Thanks in advance

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,988
    Rep Power
    9

    Default

    What exactly is the cross dissolving algorithm? Write it out in easy to follow steps, and you should have something that's pretty easy to convert to code.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    shakeel is offline Member
    Join Date
    Dec 2010
    Posts
    20
    Rep Power
    0

    Default

    Pseudocode is like this:

    Input image 1
    Input image 2
    Grab pixels from images 1 and 2
    IF width and height are same,
    In image viewer, start with image 1
    Slowly fade image 1 to image 2
    Wait till image 2 is fully reconstructed
    Fade back to image 1 again and repeat sequence
    ELSE
    Resize image and repeat operation

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,988
    Rep Power
    9

    Default

    Okay... and what part of this are you having trouble with? Where are you stuck? What have you tried?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    shakeel is offline Member
    Join Date
    Dec 2010
    Posts
    20
    Rep Power
    0

    Default

    I think this algorithm uses timers and threads but I tried to make my way around this algorithm by merging the 2 images by using pixel grabber and for loops. However, I am not getting the expected results. There are blurry lines being drawn vertically

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    You might find java.awt.AlphaComposite of interest.

    db

  7. #7
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    It'd be much easier (and more efficient) to use an alpha channel to fade back and forth than to manually grab pixels and reconstruct an image. You can easily add an alpha channel to the images if they don't already have one.

Similar Threads

  1. Cross posting question
    By tashimoto in forum Forum Guides
    Replies: 7
    Last Post: 12-28-2010, 06:06 PM
  2. java with cross-platform
    By rupeshnerkar in forum Advanced Java
    Replies: 1
    Last Post: 10-08-2010, 09:06 PM
  3. cross platform architecture in Java/J2ee
    By softbuzz in forum Introductions
    Replies: 0
    Last Post: 01-09-2010, 08:03 AM
  4. applet won't draw a cross
    By michcio in forum New To Java
    Replies: 1
    Last Post: 06-02-2009, 07:03 PM
  5. JAVA a cross-platform language? I have my doubts!
    By willemjav in forum Advanced Java
    Replies: 34
    Last Post: 10-24-2008, 11:26 PM

Posting Permissions

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