Sorry for the downtime, welcome back!!

Spriter - a chart generator for Mac

Forum and Craft Related Topics...
Post Reply
ScienceDad
Rank 4 - Raccoon Mario
Rank 4 - Raccoon Mario
Posts: 105
Joined: Thu Sep 23, 2010 10:41 pm

Re: Spriter - a chart generator for Mac

Post by ScienceDad »

Hey, that's fantastic! :grin: I notice that the 'white' colour is annotated with a semi-circle in your Mario image, however - that should have been a reserved colour and I had put a routine in for this reason, but obviously it's not working properly... hmm.

As for the colour matching, I am calculating the "Euclidean distance" of each colour in the RGB colour space to the nearest DMC thread RGB values. This is like calculating the hypoteneuse of a right-angle triangle, only in 3D. Unless there's a bug, of course!

Could you please write me the RGB coordinates of the blue colour being linked to purple?

Thanks!
- sd
pixelcraft, a free and open-source web app for making craft patterns from sprites:
http://www.theoryandwings.com/software/pixelcraft

User avatar
StitchPlease
Rank 7 - Kuribo Mario
Rank 7 - Kuribo Mario
Posts: 401
Joined: Fri Oct 23, 2009 2:26 pm
Contact:

Re: Spriter - a chart generator for Mac

Post by StitchPlease »

Would this help at all for the color matching?
http://www.csh.rit.edu/~vance/pages/color.html

Keep up the great work! It's amazing!

ScienceDad
Rank 4 - Raccoon Mario
Rank 4 - Raccoon Mario
Posts: 105
Joined: Thu Sep 23, 2010 10:41 pm

Re: Spriter - a chart generator for Mac

Post by ScienceDad »

purcell_a05 wrote:Would this help at all for the color matching?
http://www.csh.rit.edu/~vance/pages/color.html

Keep up the great work! It's amazing!
That is in fact exactly the web site from which I retrieved RGB values for DMC threads :grin:

Still, there are several pitfalls to using any set of RGB values. First, we don't know (at least, -I- don't know) how those values were generated. From a scan or photo of an actual thread? From a DMC catalogue? How accurately are colours reproduced in the source material? Second, even if the RGB values are accurate they may not reproduce well when printed out (which is in CMYK). So the colours may -look- off but will end up looking fine once you start cross-stitching. (Please correct me if I'm wrong, I'm not an authority on this and I'm sure there are more than a few graphic designers on the board :D )

Either way, it would be wicked helpful if you folks could report in any ugly misses so that I can work on improving colour assignments in Spriter. Thanks!

- sd.
pixelcraft, a free and open-source web app for making craft patterns from sprites:
http://www.theoryandwings.com/software/pixelcraft

User avatar
Lord Libidan
Rank 10 - Cape Mario
Rank 10 - Cape Mario
Posts: 1176
Joined: Wed Apr 07, 2010 1:44 am
Contact:

Re: Spriter - a chart generator for Mac

Post by Lord Libidan »

I was doing some fiddling around, trying to work out what the problem with the colours was. And I found it. That colour list goes to colour 3799. Its missing colours 3801 to 5283. Now some of those are variations (4010-4240), and some are odd colours (pearls, etc) but most are normal colours. All the colours that I thought came out wrong were in the missing section.

I also had some odd experiences with it too, sometimes it just doesn't want to work. There seems to be no pattern in the not working files though, so I'll keep using it till I can tell you more info, and also sometimes I get a crazy output. (see attachment) In short, it stripes everything. The background is mainly black, but it stripes everything else as well... It has 34 colours in the pattern, so it isn't colour heavy and all the things you've said in your first post are fine. It also appears to just be that image. I can edit it down to be smaller, copy and paste into a file that I know will work, and it still comes up with the odd results, or just won't make the pattern at all... Is it due to transparency? I don't think there is any in the image, but when putting the image together I used it to copy things in, etc...
Full Pattern.pdf
(861.87 KiB) Downloaded 235 times
EDIT: The crazy output seems to be formed when you "select all" "copy" "paste" an image into a new blank image. Using either paintbrush program or pixlr.com
I'll see what else makes it happen/how to fix it.
Image

ScienceDad
Rank 4 - Raccoon Mario
Rank 4 - Raccoon Mario
Posts: 105
Joined: Thu Sep 23, 2010 10:41 pm

Re: Spriter - a chart generator for Mac

Post by ScienceDad »

Lord Libidan wrote:I was doing some fiddling around, trying to work out what the problem with the colours was. And I found it. That colour list goes to colour 3799. Its missing colours 3801 to 5283. Now some of those are variations (4010-4240), and some are odd colours (pearls, etc) but most are normal colours. All the colours that I thought came out wrong were in the missing section.

I also had some odd experiences with it too, sometimes it just doesn't want to work. There seems to be no pattern in the not working files though, so I'll keep using it till I can tell you more info, and also sometimes I get a crazy output. (see attachment) In short, it stripes everything. The background is mainly black, but it stripes everything else as well... It has 34 colours in the pattern, so it isn't colour heavy and all the things you've said in your first post are fine. It also appears to just be that image. I can edit it down to be smaller, copy and paste into a file that I know will work, and it still comes up with the odd results, or just won't make the pattern at all... Is it due to transparency? I don't think there is any in the image, but when putting the image together I used it to copy things in, etc...

EDIT: The crazy output seems to be formed when you "select all" "copy" "paste" an image into a new blank image. Using either paintbrush program or pixlr.com
I'll see what else makes it happen/how to fix it.
Holy moly :shock:
Brilliant bug catches, LL. I can address the missing colours issue by scanning RGB values from a DMC catalogue.
But I'm totally stumped as to where that crazy output is coming from! Is there any way you could post a .png file so that I can try to reproduce the problem and track down the issue? In the meantime I'll Google around and see if this sort of issue has come up before with the Python PNG library.

Thanks!
- sd/
pixelcraft, a free and open-source web app for making craft patterns from sprites:
http://www.theoryandwings.com/software/pixelcraft

ScienceDad
Rank 4 - Raccoon Mario
Rank 4 - Raccoon Mario
Posts: 105
Joined: Thu Sep 23, 2010 10:41 pm

Re: Spriter - a chart generator for Mac

Post by ScienceDad »

Okay, I found another DMC to RGB conversion table published at http://www.xstitchtreasures.com/DMCFloss-RGBvalues.html, which has 454 DMC colours, 94 more colours than the table I had been using!

Just for giggles, I threw together a couple of 3d scatter plots using the RGB values of both sources for a side-by-side comparison:
dmc2rgb_comparison.png
dmc2rgb_comparison.png (87.75 KiB) Viewed 4559 times
What's also interesting is that these two tables disagree quite a bit! The mean distance in RGB colour space for a given DMC floss is 40 units (on a scale of 0 to 255) with an interquartile range (25%-75%) of 22.8 to 52.5 ! That's really substantial!

I'm going to roll this new table into my revision of Spriter 0.3 beta. Hopefully I'll finish writing the new function that will partition a sprite into multiple pages of output, with pixels split into 10x10 blocks that are labeled with numbers. Also adding thread counts into the legends, with page-specific and overall counts.

I love to code :grin:

- sd.
pixelcraft, a free and open-source web app for making craft patterns from sprites:
http://www.theoryandwings.com/software/pixelcraft

User avatar
Lord Libidan
Rank 10 - Cape Mario
Rank 10 - Cape Mario
Posts: 1176
Joined: Wed Apr 07, 2010 1:44 am
Contact:

Re: Spriter - a chart generator for Mac

Post by Lord Libidan »

ScienceDad wrote:But I'm totally stumped as to where that crazy output is coming from! Is there any way you could post a .png file so that I can try to reproduce the problem and track down the issue? In the meantime I'll Google around and see if this sort of issue has come up before with the Python PNG library.
Well I was going to, but its not doing producing anything for any new files I create. I don't remember having that problem with v0.1, so it might be something in the build...
You asked for a png, which I could easily do, but any downloaded image works fine. Its just ones I create myself...
Image

User avatar
amneufeld
Rank 5 - Frog Mario
Rank 5 - Frog Mario
Posts: 210
Joined: Wed Dec 29, 2010 9:47 pm

Re: Spriter - a chart generator for Mac

Post by amneufeld »

454 is the current total of solids. so nice find. Lot of places are missing those last few dozen new ones.

ScienceDad
Rank 4 - Raccoon Mario
Rank 4 - Raccoon Mario
Posts: 105
Joined: Thu Sep 23, 2010 10:41 pm

Re: Spriter - a chart generator for Mac

Post by ScienceDad »

Tonight I'm posting Spriter v0.3 beta, with the following new features and bug fixes:

- partitions sprite image into 50x50 pixel grids on printable 8.5"x11" (landscape) pages
- legends have page-specific and total thread counts
- now using complete table of DMC RGB values
- program automatically opens PostScript file as PDF after processing
- pixel grid partitioned into 10x10 subgrids
- grid axes are labelled at every 10-th row and 10-th column
- changed packaging of application to be (hopefully) independent of Python2.x version number - please report any problems using this update!
- "icons" (annotations of pixels of similar colours) are now drawn in a colour that is related to the base colour, instead of just black or white - this makes for a more visually-appealing overall chart
- tinkered with how "icons" are being drawn
- legend now only lists thread colours that are present on the current page, in an attempt to prevent colour-rich sprites from causing the legend to overrun the size of the page
- writing better PostScript code to make smaller files
- legend no longer contains duplicate DMC colours (resulting from 2 pixel RGBs matching the same thread)

To download, please go to the first post in this thread, where I will have replaced the .zip file attachment.

Here is an example page (10 of 20) taken from a Super Mario World 3 map (as usual, converted to PNG from the PDF output of Spriter):
mario2k3-map1-pg10.png
mario2k3-map1-pg10.png (32.41 KiB) Viewed 4519 times
Share and Enjoy! :grin:

(And please keep reporting those bugs, it's a huge help!)
- sd.
pixelcraft, a free and open-source web app for making craft patterns from sprites:
http://www.theoryandwings.com/software/pixelcraft

User avatar
Lord Libidan
Rank 10 - Cape Mario
Rank 10 - Cape Mario
Posts: 1176
Joined: Wed Apr 07, 2010 1:44 am
Contact:

Re: Spriter - a chart generator for Mac

Post by Lord Libidan »

Wow. You really did some work on it... a lot better.
The colour lists are a bit odd though. Have you thought about having a full list on its own page at the end, it would make things less confusing. and then you could have a larger section on each page for the pattern... (That's what KGchart does) I assume making it so only a set number of colours come up on that page and the rest on another is easy enough?
I also still can't get the program to deal with new images. Only downloaded and images prior to downloading it...

EDIT:
The weird output. Worked it out. Its all down to dimensions. I'll explain with files so you can try it yourself. The original image works fine. Image 2, which is a slice of the original image comes up with the odd output. The previous images I've had problems with are also thin but long images. I don't know what the dimensions need to be to stop this yet, but its the same if its too wide with a thin height.
(In spoiler tags to reduce space)
Spoiler
Original image:
thjuyhtr2.png
thjuyhtr2.png (5.93 KiB) Viewed 4502 times
Image 2:
test1.png
test1.png (1.35 KiB) Viewed 4502 times
Output:
test1-output.png
test1-output.png (196.44 KiB) Viewed 4502 times
Image

Post Reply