Register
Email: Password:
Forum » My Picture Generator!

My Picture Generator!

E_net4 16 years ago
When I was on Holidays, I had the idea to make This: 4Pics!
Current version is 0.8
Download it here.
If it doesn't work, go to the folder
This program generates a picture, pixel by pixel. It supports some colour bit modes and can save it into a bitmap file.
Try it and tell me what you think. *

Randomly generated picture, by the program:

* Insults, stupid comments, jokes and bad critics are not allowed.
#
Crazy 16 years ago
* Insults, stupid comments, jokes and bad critics are not allowed.
Have we really gotten to the point where you need to add this beforehand?
#
E_net4 16 years ago
"Crazy" said:
* Insults, stupid comments, jokes and bad critics are not allowed.
Have we really gotten to the point where you need to add this beforehand?
It's just to remmember you folks that this forum has rules.
#
Grim Reaper 16 years ago
Gah! The image, it plays tricks with my built-in pattern finding mechanisms (which all more-or-less normal humans have)!

So, does this image have any actual use?

Nevertheless, this gave me an idea for a random program maker thing. Just combine your 4pics thingy and hook it up with a Piet interpreter and see what happens!
#
Amarth 16 years ago
Kinda cool...

First of all. For the program itself - good. Just entering my thoughts now - some things will be harder to do than others if you ever want to 'improve' it (that is, improve according to MY views), I don't attempt to think about that now.

The double-click-to-safe is a nice thing, something I wouldn't have thought of. The interface seems OK. Entering a non-numeric value in the 'pixels' fields crashes the program, bad. Automatic resizing is strange and doesn't really work. Why are the stats limited to fairly small images? Hotkeys would be fine. Why am I limited to 999x999?

But all in all, pretty good.

Now. I, being the programmer, mathematician and general geek I am, would add some sort of after-effect to it, but I'm not sure you'll survive the maths (I barely did). For the real cool ones (filtering, sharpening, noise reduction), you'll need advanced knowledge of signal processing - Fourier transforms and ugliness like that. Not too useful on random images.

But how about this? Instead of creating a color value completely at random (as I suppose you do now), look at the colors you already have and create a random color close (you could use hex values) to the current color. This may give problems at the borders - suggested method: fill in the top and left of the pic with a separate loop, using one color. Then work row by row, generating new values from the ones to the top and left of it.

I think the effect might be fun. I might be wrong, too. Experimentation is key.
#
E_net4 16 years ago
Good idea, man.
I might put that to work. And here are the answers to some questions of yours:

I know it crashes when you input a non-numerical value, but I can fix it (and I will).
Also, it's limited to 999x999 because of the window resizing and stuff... It's still to be worked, you know.

By the way, Grim, what's a Piet interpreter?
#
Amarth 16 years ago
"E_net4" said:
what's a Piet interpreter?
Piet is a programming language. Instead of using text files as programs, it uses bitmap files. Also see Wikipedia.

It doesn't really do a lot of good things, but Grim and I once were a bit obsessed over it and start interpreting avatars on the forum as Piet programs. Nothing too useful came out of it.
#
E_net4 16 years ago
Well lol... I'll be making another colour mode! XD
By the way, I'm currently messing up with the resize window event.
By the way, the "No Stats when too big picture" has to do with the pixels. They are too many to be stored in a long-type variable.
#
Amarth 16 years ago
"E_net4" said:
By the way, the "No Stats when too big picture" has to do with the pixels. They are too many to be stored in a long-type variable.
Hmm. Surprises me. IIRC, long is 4 bytes, or roughly 2^31 = 2 147 483 648 (1 bit for sign). A picture of 1024*1024 pixels has 1 048 576 pixels, which is several orders of magnitude lower. Not that I know how your code is structured or what number you are actually referring to.

I take it VB doesn't have a BigInt class to represent arbitrary big integers? Would be useful.

Though, since you're only printing it out, you could calculate it in strings. Not trivial, I guess, but should be possible if you only want to multiply some numbers.
#
E_net4 16 years ago
Huh, calculate in string?
It'd be great, but still, how?
I've finished with the resize stuff, and also I made something to add text into the picture (Zombie's suggestion).
#
Amarth 16 years ago
"E_net4" said:
Huh, calculate in string?
It'd be great, but still, how?
For the slow and memory intensive (but easy to explain) version, textbook multiplication.

Assume numbers num1 and num2, with 0 <= num1,num2 <= 2 147 483 647. Say num1 = 146576 and num2 = 46578643. Note that num1*num2 does not fit in a long. Split num1 and num2 in decimal representation in two arrays: a[0] = 6, a[1] = 7, a[2] = 5, etc. If you wish to know the lengths of the arrays in advance, the log10 function is your friend. Let's say num1 has n digits and num2 has m digits ( here n=6, m=8 ).

Assign a 2D array c[m][m+n+1], fill it with zeros. The rows will hold the rows of the multiplication, the columns the digits. Also create an array d[m+n+1] to hold the final result, fill with zeros.

Calculation like this (note - pseudocode):
for (i=0;j<m){
for (j=0;j<n){
result = a[j]*b[i]
c[m][m+n] += result % 10
c[m][m+n+1] += result / 10
}
}

for (i=0;i<m+n+1){
result = 0
for(j=0;j<m){
result += c[j][i]
}
//if m could be strictly bigger than 11, you might need division by 100 and three cells here
d[i] += result % 10
d[i+1] += result / 10
}


Then make a string out of the digits in the array d.

Possible optimizations: don't split with tens but with 10000s (10000^2 should fit in a long). Don't waste space and time on all the zeros. Use binary notation and split on 2^16. Use a better method or a better language that natively supports this.
#
E_net4 16 years ago
Man, I'm confused.
But I think I got it.
And I still didn't manage to get a working Piet Interpreter.
#
E_net4 16 years ago
New version! 0.8! Includes one more colour mode (20 colours, from Piet), Text addition to the picture and a good working window.

Pic:
#
Amarth 16 years ago
Fun. VB6 can do a little more than I thought it could do (or you have an insane amount of code there).

Minor things: resizing still doesn't work for me, it'd be helpful if you auto-select one of the choices for bitmap for us at the start of the program, and it'd be fun if the fields to enter the pixels would auto-select there if you tab into them, so that you can just type the numbers immediately. Not sure how to do the last one, but I think it's some VB function somewhere.
#
E_net4 16 years ago
"Amarth" said:
Fun. VB6 can do a little more than I thought it could do (or you have an insane amount of code there).
Either VB6 can kick many backs or I'm using lots of code.

"Amarth" said:
Minor things: resizing still doesn't work for me, it'd be helpful if you auto-select one of the choices for bitmap for us at the start of the program, and it'd be fun if the fields to enter the pixels would auto-select there if you tab into them, so that you can just type the numbers immediately. Not sure how to do the last one, but I think it's some VB function somewhere.
I don't see the point about resizing, it works fine in here. What does it happen when you resize the form?
#
Amarth 16 years ago
Mmm, no, resizing the form works. I was just thinking that you'd have it auto-resizing when the picture doesn't fit in the current view.
#
E_net4 16 years ago
Well, that's different.
Still, you can just stretch the window and everything looks just fine.
Heh, I just tested the Piet coloured pictures. They went funny, but Unfortunately, they made an infinite loop, which forced me to close cmd.
#
NeoGangster 16 years ago
it always creates infinitife loops :/
only with much luck we could get a working piet program :]
#
E_net4 16 years ago
All this stuff made me think about making a Piet Interpreter. It would be different from all others, unfortunately, it would only load .bmp files. (Unless you find a way to open other formats with VB6)
#
Forum » My Picture Generator!

Post Reply


Your email:
Your name: