Forums

Topic: Petit Computer

Posts 2,801 to 2,820 of 9,620

ramstrong

randomouscrap98 wrote:

ramstrong wrote:

When I plan on Petit Computer, I usually just use pen and paper. Lately, I have a composition notebook that I use as a journal. Usually, though, I just use the IDE as an outliner, doing top-down design right there on the editor and fill in the blanks, so to speak.

That's cool, I didn't know PTC Utilities was so powerful.

I'm not using PTC Utilities to write my programs. All my programs have been done with stylus on DSi itself. That's why I'm using pen and paper for planning instead of IDE. But if you want to use IDE, just grab random ones and use that. Preferably one that you can turn Syntax coloring off. Or just grab some favorite text editor and copy to PTC.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Pixelrobin

My pixel art program is near completion, But yet so far because of my broken 3ds. Arrrrrgggggghhhhh! Oh well...

Fearures so far:

  • Edit and create your own pixel art.
  • Send your art to others in the software itself (full testing needed)
  • Save art as a GRP you can use in games
  • Choose from 15 colors (colours) for that true 'retro' look

Features to come:

  • Create pixel art from any GRP

Who thinks they would use something like this?

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Sniper101

@Bluerobin2 The pixel art program seems pretty fun. I would like to use it.

Sniper101

3DS Friend Code: 2208-4619-7423

bmx7000

@ramstrong thanks but i got spofs to start where i wanted it if you set it like spofs 1,240,180,0 it goes there instantly

bmx7000

ramstrong

Bluerobin2 wrote:

@everyone Heads up, I'm sending in my 3ds for repair (Luckly I still have the warranty). My L, R and B buttons quit working all of a sudden, The system thinks i'm holding down A when I press it, and the touch screen does not work for some applications such as Swapnote.

That sucks. I'm glad you have warranty, but not being able to code until then, well, that's no good. Luckily mine still works, although the L button is somewhat problematic. I think it twisted the wrong way when I had it in the pocket. Trouble waiting to happen, for sure.

Regarding color reduction, the easiest method would be AND 0x0F. Doesn't really work too well, but it sure is quick and easy!
I'd give the 16 most used color careful consideration, as I'd prefer manual color specification. It works okay if you want 16 (or 15) colors, but if you want more, then you'd go dithering the colors, and you need to manually select the palette for best result. IMHO.

bmx7000 wrote:

@ramstrong thanks but i got spofs to start where i wanted it if you set it like spofs 1,240,180,0 it goes there instantly

Ummm, are you asking for SPHOME or SPOFS? SPOFS is for moving the sprites, SPHOME is for determining the center of the sprite, mostly useful for rotation and collision checking. Discostew did an excellent explanation of it a few posts back.

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Pixelrobin

@ramstrong please explain further.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

ramstrong

Bluerobin2 wrote:

@ramstrong please explain further.

The explanation is rather long, and I wonder if you know what I mean without seeing code.

The dithering method is simply checkerboarding different colors. If you mix black and white, for example, you get gray. Assuming the picture has 5 shades :White - light gray - gray - dark grey - black, and that gray is sparse where white/light and dark/black is predominant, the automatic select most colors will get white+black. The dithering method means you can specify white+gray+black and get five shades, instead of 2.

I would dither by checkerboarding colors. There are other ways to dither, some are sophisticated, but I'd stick with simple method for now. If you take the 15 colors available and pair them, you get 1-1,1-2,1-3 ... 2-2,2-3,2-4,...3-3,3-4,3-5,... and so-on. So by using distance formula for RGB, you can replace the palette colors with closest match of two colors.

After that, you simply render the higher palette colors as checkerboard, which will give you more apparent colors than just 15.

checkerboard formula comes in two flavors depending on whether the width is odd or even:
(1) (y*width+x)%2
(2) (x+y)%2
HTH

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Discostew

@Bluerobin2

I spent the earlier part of today working on a program that would reduce a GRP with a set palette up to 256 colors down to an x-count palette, and it is looking mighty well right now. It doesn't use any of the versions I described before. Instead, it works off a color cube and clustering, determining an appropriate palette based on how many colors you want in it, and adjusts the entire GRP. It has a few bugs, but it's a little more than 100 lines of code. No dithering yet, but I'll get to that later. I'll make the program available after I do the dithering. If I don't get to it done in a reasonable amount of time, I'll just post what I have.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Pixelrobin

@Discosrew @ramstrong thanks! You are going into the credits. Even though my 3ds isn't working very well, I can still use PTCOM to some extent. I am very proud of my current accomplishment with the program. It has moving menus and screens and I tried to make it as polished and glitch-free as possible. I even took extra time to add save/load name filters; A feature overlooked by some. This will be one of my best programs yet IMO.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Discostew

I'm getting close to finishing up this side-project. I added dithering, based on the Floyd-Steinberg dithering algorithm. While it works, the process of dithering is incredibly slow, and gets worse the more colors you wish the finalized GRP will use. The culprit is the FindNearestColor subroutine, which for every pixel, it has to go through the palette list and find which it is closest to. It is so slow that in order to process a GRP to utilize 15 actual colors (the transparency counts as the 16th), it takes 5.6 minutes to run through the dithering algorithm. I'm hoping for a breakthrough that will reduce the time to process it while not having to rely on making an array to hold the entire GRP as a 24-bit image (which is equal to a 147,456 element array, over half that is allowed) to speed it up.

I may release this tomorrow, but first I need to check my color quantizer code, because I think I made a miscalculation. Based on the algorithm I studied to make it, I thought I had to use the average of a cluster set for splitting them, but it says I needed to use the median. The median of a set can be rather different than the average, resulting in a somewhat different palette list in the end, though the one it creates now isn't too bad.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Discostew

Changed the color quantizer to use the median of a cluster rather than the average, and now the result looks a bit better. I doubt I can speed up the dithering process without some major modifications, and even if I did, I wouldn't know how much extra speed it would produce. Other than that, I'm just making a few touch-ups, like showing the original GRP on the bottom screen while the top screen shows the image being processed. Likelihood of a release tonight went up.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Pixelrobin

Ahem @Discostew I should of told you earlier. I do not need to go through every pixel, The way my program pixelizes things is by splitting the GRP into 8 by 8 squares, then uses the color in the centerin each "square" using FOR. You didn't need to go THAT far. Thanks anyway and sorry

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Discostew

Bluerobin2 wrote:

Ahem @Discostew I should of told you earlier. I do not need to go through every pixel, The way my program pixelizes things is by splitting the GRP into 8 by 8 squares, then uses the color in the centerin each "square" using FOR. You didn't need to go THAT far. Thanks anyway and sorry

That...puts it into perspective and clarifies things. Well, it was a nice side-project anyways. So, basically what you're looking for is to take an image (128x128 for example), and shrink it down to say 16x16 pixels, utilizing only the first 15+1 colors? Is the palette meant to be generated from the pixel art, or you plan on having a default palette for it?

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Pixelrobin

@Discostew what I am saying is, you don't have to search pixel by pixel, But rather every 8 by 8 pixels:
(8,8) → (16,8) → (24,8)
(or was it 4? Its half a background tile for shure)
and so on. It then checks the color and makes a background tile on the bottom screen. This works for opening existing art, But you get a mess of grass and wood tiles once you open a GRP withother colors. I cant post code now (Mobile) But I think it would be easy to make it to jump some pixels rather than checking every one. Don't you think? Other than tgat though, My program is DONE. I've had people test it and late night programming sessions to get it done. I want to make it look dsiware-ie . Thanks for all your help. I guess from now on its a 3-way group project. Maybe @randomouscrap98 could make some quiet, soft, 8-bit background music? And then @Morphtorok could brighten up the visual feel a bit? That would be a great cooperation. Maybe you should wait for version 1 I guess, Then work off that... I'm writing as I think. Wow.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

randomous

@Bluerobin2 I'd like to see it first to get a feel for how it works before I make the music. I want it to match lol. That said, it's not like I'm some sort of "excellent composer", so it probably won't be great, but it should hopefully fit.

randomous

Discostew

@Bluerobin2

So, if I understand you correctly, you want something similar to this.

From...
Untitled

...to...
Untitled

Is that right, but only utilizing 15+1 colors, where each unique tile is a single color of one of those in the palette?

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Sniper101

Is there a command that clears a certain variable/variables?

Sniper101

3DS Friend Code: 2208-4619-7423

Discostew

Sniper101 wrote:

Is there a command that clears a certain variable/variables?

The only way to clear anything from memory is via CLEAR, but that clears everything, removing variables, arrays, etc.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Pixelrobin

@Discostew YES! PERFECT! WOWZA!
@randomouscrap98 and everyone I will post it asap. I'm just on mobile right now :/

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Please login or sign up to reply to this topic