
-----------------------------------
Delos
Sun Aug 29, 2004 5:57 pm

PicMerge Version 1.0
-----------------------------------
Greetings fellow CompSci.ca-ers.

A while back I released PM me if you need the file in a format other than .zip.

-----------------------------------
the_short1
Sun Aug 29, 2004 6:39 pm


-----------------------------------
ummm... u do know u can use



Pic.Draw (x,y,name,MERGE) or soemthing like that...

?

-----------------------------------
Delos
Sun Aug 29, 2004 10:48 pm


-----------------------------------
My dear, innocent, confused short1.

Dl the proggie.  Run it.  *Then* tell me to use picMerge.

-----------------------------------
the_short1
Sun Aug 29, 2004 10:57 pm


-----------------------------------
ok..i will tomorow.. yea.. foolish me..

-----------------------------------
Paul
Mon Aug 30, 2004 8:48 am


-----------------------------------
Very Very nice man. This program can do what I couldn't do in less than 1 minute (before I had photoshop) and could still do it faster than I can do in photoshop. Have all my bits  :wink:

-----------------------------------
JHDK
Mon Aug 30, 2004 1:12 pm


-----------------------------------
When the pictures are different sizes it gets messed a bit.
However it's a great program you coded here.

-----------------------------------
Delos
Mon Aug 30, 2004 1:14 pm


-----------------------------------
Yeah...differing pic sizes do pose a minor problem.  I've begun work on an update, which will basically be the same thing, but will have more options and such...if indeed it comes into being...hehehe.

-----------------------------------
rizzix
Thu Sep 02, 2004 2:19 pm


-----------------------------------
hmm well wanna testdirve my alpha lib? its based on the latest imglib of mine.. its not the same as the one poseted in the forum... a little diff.. too lazy to update it here.. cuz well it has more than one file heh.

-----------------------------------
rizzix
Thu Sep 02, 2004 2:37 pm


-----------------------------------
aha i tested my stuff out my self. :mrgreen:... and here's the result.. but for those still confused what the program i supposed to do.. its all about transparency! lol

test2.bmp is transparently placed over
test3.bmp (the background)
at an alpha index of 0.5
and you get
result.bmp

-----------------------------------
the_short1
Thu Sep 02, 2004 6:28 pm


-----------------------------------
just like in paintbrush...but with more then juse the white color... hmm... od... i have absolutely no clue how u did that.... nifty... i didnlt clue in at first cuz im stupid... duh..

-----------------------------------
rizzix
Thu Sep 02, 2004 6:57 pm


-----------------------------------
want to see something even cooler? try using an alpha mask instead of another picture. and see the really cool effects u can attain!

i'm attaching a monochrome alpha mask (basically what this means is that it can only state whether an area is to be displayed or not) u can still use alpha setting but it will result in a the picture merging with the white background where there is no "set bit" and will result in a faded image.. u can get around this by simply fixing the alpha index to 0.

-----------------------------------
Delos
Thu Sep 02, 2004 10:08 pm


-----------------------------------
Neato!

So does this mean that I inadvertantly stumbled upon a form of 'alpha-masking' meself?  Now that would be an acheivement...

-----------------------------------
the_short1
Fri Sep 03, 2004 11:42 am


-----------------------------------
delos.. omfg... u are a GOD..

thats something ... wow..



true it made it look like shit for the thing i made cuz it had over the 255 colors... :(


dam..


im curious to how it works....

is it something like:


read (1,1) of first picture... output to result... read (2,1) of seond picture.. output to result...  read (3,1) of frsit picture.. output to result..

pixel by pixel.. then to the next row.. 
???

-----------------------------------
the_short1
Fri Sep 03, 2004 11:48 am


-----------------------------------
MAN! thats just a great program! really good for making GRADIENTS!!!!!



and i have a suggestion.... isntead of asking first pic and second pic... say foreground and background...  yea i read the readme.... but that way there.. ppl dont have to  to generate the result they like...

-----------------------------------
rizzix
Fri Sep 03, 2004 12:26 pm


-----------------------------------
hmm no one wants to testdeive my program? (and i being a programmer.. feel very dissapointed) :cry:

-----------------------------------
Paul
Fri Sep 03, 2004 3:12 pm


-----------------------------------
I'd test it, but I'm content staring at the jiraiya picture all day.

-----------------------------------
Delos
Fri Sep 03, 2004 7:11 pm


-----------------------------------
Frog Hermit!!!  Boo-yeah.

And if you really want your proggie to have interest taken in it, make a thread!  Lol.

And short1, thank you for the regal comment, much appreciated.  As for how it works...that may go with me to the grave...hehehehe...it's not that complicated once if you take a look at the last number of submissions of mine...you'll see a pattern.

-----------------------------------
apomb
Mon Sep 13, 2004 11:19 pm


-----------------------------------
hey delos, i was messing around with your last code submission (sort-of merger, but a lot more grainy) in this thread and i came up with my avatar! i think it worked O.K, but i cannot see what the real picture would have looked like cuz i deleted the "compwiz" turtle pic  :*(

-----------------------------------
Delos
Tue Sep 14, 2004 3:52 pm


-----------------------------------
Hmm...at the moment I cannot actually see your avatar!  Perhaps your hotlinking is, umm...full of "features".

I tried a direct link to the Google site its hosted on and got a '502 Server Error'

-----------------------------------
Paul
Tue Sep 14, 2004 4:36 pm


-----------------------------------
his avatar is apparently a gmail attachment... for a second there, I thought it to be an invite... then it'd be clever indeed.

-----------------------------------
apomb
Wed Sep 15, 2004 8:58 am


-----------------------------------
well, i can see it no matter where i am :? , mabey ill change the placement of it...

-----------------------------------
Delos
Wed Sep 15, 2004 11:35 am


-----------------------------------
Wherever you are?  Wow...maybe cookies for you?  I just see the x-box thingy...

-----------------------------------
apomb
Wed Sep 15, 2004 8:18 pm


-----------------------------------
ya, i cant see it now, im on a different computer ... whatever, CHANGED

-----------------------------------
jamonathin
Tue Jul 05, 2005 9:30 pm


-----------------------------------
I know this a really old topic, but i know that Delos is still around, and . . you shouldn't refer to it expecting no one to post on it . .  :lol: .

Anyways, I was looking at these programs, and im curious to know how you did them.  I made one of my own, and below is the result of what i got, however it takes like, seriously 15 minutes to do.  Quite rediculous.

I was wondering if anyone of you guys could help me find a way to speed up this pos.  :?

-----------------------------------
Delos
Wed Jul 06, 2005 9:42 am


-----------------------------------
Well, for a start you can remove things like "drawdot (w, h, black)" since they will slow things down.
I ran it on some pics, about 300x400 and it took less than a minute.  I'm guessing your computer is slow?
Anyhow, your method is pretty tripped out.  And not in the good sense either.  You have 3 loops (of 6 possible) that a single pixel must go through before it is released.  Themselves, wrapped in if statements.
Yes, that is very slow.

And what do these loops accomplish?  Well, it looks as though it is attempting to find some 'common ground' between the two pixels being analyzed.  So, why go through the slow, laborious, and ultimately inaccurate process of comparisons, subtractions, and iterations - when you could simply take an average.
All of a sudden, ~5 iterations has been cut down to 1!  Try it, it should work faster.

-----------------------------------
Cervantes
Wed Jul 06, 2005 10:15 am


-----------------------------------
Jamonathin: Why do you have to loop through and incriment  the r, g, and b values until they are close together?  Why don't you just average them?  That's how I figured these things were done.  Also, don't drawdots all over the screen.  If you want that effect, just draw a fillbox.

Here's what I've done.  It's a heck of a lot faster, largely because I don't have those incrimenting loops.  Also, I didn't bother storing the colournumber of the second picture.  I just used it immediately in my calculations.

If you want to merge two pictures of different sizes with this, make sure the smaller picture is pic1.  There's probably a problem (ie. it will redraw the pixels and make them look shitty) if one picture is wide and the other is tall.

I think things would look better if Turing's colour palette were better.  We're limited to having 256 colours, but does anyone know an algorithm to create a good palette within those 256 colours?  It should not be like Turing's hard colours -> softer colours -> darker colours -> very dark colours.  

If you uncomment the for loop (lines 10 to 12) you can get a nice looking greyscale merge.

Here's the code.  I used pictures from my FP.

var pic1 : int := Pic.FileNew ("theatre/Pictures/main.jpg")
var pic2 : int := Pic.FileNew ("theatre/Pictures/intro.jpg")
var maxWidth := max (Pic.Width (pic1), Pic.Width (pic2))
var maxHeight := max (Pic.Height (pic1), Pic.Height (pic2))
setscreen ("graphics:" + intstr (maxWidth) + ";" + intstr (maxHeight) + ",nobuttonbar,position:center;center")
var c1 : array 0 .. maxWidth, 0 .. maxHeight of int
var r, g, b : array 1 .. 2 of real

%Make the pallete shades of grey
%for i : 0 .. 255
%    RGB.SetColour (i, i / 255, i / 255, i / 255)
%end for

%Using whatdotcolour, get the colour number of each pixel in the first picture
Pic.Draw (pic1, 0, 0, picCopy)
for x : 0 .. maxWidth
    for y : 0 .. maxHeight
        if x 