How to melt two images in one in Hollywood?

Discuss any general programming issues here
Post Reply
User avatar
Juan Carlos
Posts: 950
Joined: Mon Sep 06, 2010 1:02 pm

How to melt two images in one in Hollywood?

Post by Juan Carlos »

How to melt two images in one in Hollywood?
I want make this option in my old program Convierteme, the option of melt two images in one, for example to make one "ghost" effect in other image, with what instruction make this effect, to save after?
jalih
Posts: 281
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: How to melt two images in one in Hollywood?

Post by jalih »

Here you are: ;-)

Code: Select all


@DISPLAY {Width = 640, Height = 480, Title = "Test Proggy..."}

@BRUSH 1, "bg.png", { LoadAlpha = True } ; Backgound image
@BRUSH 2, "fg.png", { LoadAlpha = True } ; foreground image


Function p_MainLoop()
	SelectAlphaChannel(2)
	SetAlphaIntensity(intensity)
	Cls()
	EndSelect()
	intensity = intensity - 1
	intensity = Wrap(intensity, 0, 255)

	DisplayBrush(1, 0, 0)
	DisplayBrush(2, 0, 0)
	
	Flip()
EndFunction


intensity = 255

BeginDoubleBuffer()

SetInterval(1, p_MainLoop, 1000/20) ; 50fps   

Repeat
   WaitEvent
Forever
User avatar
Juan Carlos
Posts: 950
Joined: Mon Sep 06, 2010 1:02 pm

Re: How to melt two images in one in Hollywood?

Post by Juan Carlos »

Thank you Jalih for your help but you routine isn't that I need, I need one idea to join two images in one, Image1 add to Image2 to save in Image3 with both.
jalih
Posts: 281
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: How to melt two images in one in Hollywood?

Post by jalih »

Juan Carlos wrote:I need one idea to join two images in one, Image1 add to Image2 to save in Image3 with both.
How about:

Code: Select all


@DISPLAY {Width = 640, Height = 480, Title = "Test proggy, attempt 2 ;-)"}


@BRUSH 1, "data/bg.png", { LoadAlpha = True } ; Backgound image
@BRUSH 2, "data/fg.png", { LoadAlpha = True } ; foreground image



Function CreateGhostImg(target, bgImg, fgImg, percentage)
	Local temp = CopyBrush(fgImg, Nil)
	SelectAlphaChannel(temp)
	SetAlphaIntensity(percentage / 100 * 255)
	Cls()
	EndSelect()

	SelectBrush(target)
	DisplayBrush(1, 0, 0)
	DisplayBrush(temp, 0, 0)
	EndSelect()
	FreeBrush(temp)
EndFunction


CreateBrush(3, 640, 480)
CreateGhostImg(3, 1, 2, 50)
DisplayBrush(3, 0, 0)

WaitKeyDown("SPACE")
User avatar
Juan Carlos
Posts: 950
Joined: Mon Sep 06, 2010 1:02 pm

Re: How to melt two images in one in Hollywood?

Post by Juan Carlos »

Thank you Jalih, I'll have test it to see if your routines is that I need.
Thank yo again for your help.
User avatar
Juan Carlos
Posts: 950
Joined: Mon Sep 06, 2010 1:02 pm

Re: How to melt two images in one in Hollywood?

Post by Juan Carlos »

Thank you again Jalih for your help your routine works fine, now I want try to your routine works with three pictures for my next Amiga project.
Post Reply