Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: flyingfisch on October 28, 2013, 12:27:45 pm

Title: Open Sprite Library
Post by: flyingfisch on October 28, 2013, 12:27:45 pm
I have been thinking about doing this for a while, and I wanted to get some feedback before I invest a lot of time and effort into it.

I was thinking that it would be cool to have a web tool that would allow artists to upload sprites in png form with a name and possibly tags, and then the server-side software would convert it to SourceCode-style sprites, and upload it to the server. Programmers could then search the site for sprites that they need, and have the sprite data ready to copy and paste into their programs.

What do you think?
Title: Re: Open Sprite Library
Post by: Eiyeron on October 28, 2013, 12:31:54 pm
There is already open Game Art (http://opengameart.com)
Title: Re: Open Sprite Library
Post by: flyingfisch on October 28, 2013, 12:34:17 pm
well, first of all, that domain name looks like its for sale, and secondly, I don't think it would give you sprite data to copy/paste into a program, would it?
Title: Re: Open Sprite Library
Post by: Eiyeron on October 28, 2013, 12:35:41 pm
My bad, it's .org (http://opengameart.org)
Title: Re: Open Sprite Library
Post by: flyingfisch on October 28, 2013, 12:36:16 pm
Oh, ok :)

EDIT:

I thought that maybe it would be nice to have a calc centered version of that, but let me know if it would be worth the effort, that's why I made this thread ;)
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 28, 2013, 12:56:52 pm
Totally worth it IMO.
Title: Re: Open Sprite Library
Post by: Sorunome on October 28, 2013, 01:23:57 pm
That is a pretty awesome idea IMO! :D
Title: Re: Open Sprite Library
Post by: flyingfisch on October 28, 2013, 01:26:23 pm
I think I will make a poll. If more are for than against, I'll do it. ;)
Title: Re: Open Sprite Library
Post by: Sorunome on October 28, 2013, 01:26:50 pm
lol, i can't see anybody being against it >.<
Title: Re: Open Sprite Library
Post by: Eiyeron on October 28, 2013, 01:32:10 pm
Mmmh. Sincerely why not!
Title: Re: Open Sprite Library
Post by: flyingfisch on October 28, 2013, 01:36:59 pm
poll added :)

lol, i can't see anybody being against it >.<

No, but it may not be worth the effort since Open Game Art would do everything this would except having copy/paste sprite data.
Title: Re: Open Sprite Library
Post by: Sorunome on October 29, 2013, 11:48:17 am
But I bet it would still be fun to program it, even though it already exists :)
Title: Re: Open Sprite Library
Post by: Xeda112358 on October 29, 2013, 11:59:34 am
PixelScape (http://clrhome.org/pix/) Does some of that, so maybe you could propose something like this to Deep Thought who I believe worked on Omnimaga's new image uploader, too. Maybe he could allow users to upload images that included tags to the repository, then have PixelScape be able to search the repository (as well as anybody on Omnimaga looking for images in the uploader), then the user could click the one they want and options for copy/pasting it to the editor, or directly reading it in some format for source code.
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 29, 2013, 12:03:20 pm
We could also make a site that takes sprites from OGA and convert them to code. Combine it to a userscript and you're all set. :D
Title: Re: Open Sprite Library
Post by: Eiyeron on October 29, 2013, 12:04:31 pm
YOu and your usercripts infected me! Hurrah for userscripts!

But OGA don't have standards, many files are zipped, some sprites aren't ngrid aligned and so on...
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 29, 2013, 12:10:04 pm
Then let's just run our own DB ! :D
Title: Re: Open Sprite Library
Post by: Sorunome on October 29, 2013, 12:14:12 pm
PixelScape (http://clrhome.org/pix/) Does some of that, so maybe you could propose something like this to Deep Thought who I believe worked on Omnimaga's new image uploader, too. Maybe he could allow users to upload images that included tags to the repository, then have PixelScape be able to search the repository (as well as anybody on Omnimaga looking for images in the uploader), then the user could click the one they want and options for copy/pasting it to the editor, or directly reading it in some format for source code.
Yup, deep wrote the image uploader, i host and maintain it, and because i host it it can't really be linked easily to pixelscape, different servers...and the image uploader doesn't use a database of any kind.
Title: Re: Open Sprite Library
Post by: flyingfisch on October 29, 2013, 12:15:02 pm
PixelScape (http://clrhome.org/pix/) Does some of that, so maybe you could propose something like this to Deep Thought who I believe worked on Omnimaga's new image uploader, too. Maybe he could allow users to upload images that included tags to the repository, then have PixelScape be able to search the repository (as well as anybody on Omnimaga looking for images in the uploader), then the user could click the one they want and options for copy/pasting it to the editor, or directly reading it in some format for source code.

Well, since TakeFlight and ClrHome are partners, and this project is going to be cross-platform, I see no reason why I shouldn't talk to Deep about it. :)
Title: Re: Open Sprite Library
Post by: Eiyeron on October 29, 2013, 12:16:38 pm
Will it be able to support more than 4 shades of gray? I'd like to put my deliciously colroed sprites in it! :p
Title: Re: Open Sprite Library
Post by: flyingfisch on October 29, 2013, 12:23:42 pm
Will it be able to support more than 4 shades of gray? I'd like to put my deliciously colroed sprites in it! :p

I think we could do that. :)

but really, the first thing we need is the source code for sourcecoder, or maybe kerm could make some sort of api. Otherwise, I suppose I could try writing an image converter from scratch...
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 29, 2013, 12:24:49 pm
Of course, but it will only work for color calcs (though we can have a greyscale converter).
Title: Re: Open Sprite Library
Post by: flyingfisch on October 29, 2013, 12:31:52 pm
It would work like sourcecoder, ideally.
Title: Re: Open Sprite Library
Post by: tpt1234567890 on October 29, 2013, 05:45:58 pm
i think this would be nice
Title: Re: Open Sprite Library
Post by: flyingfisch on October 30, 2013, 12:25:28 pm
OK, I am going to PM kerm for the sourcecoder source code, we'll see how it goes. :)
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on October 30, 2013, 12:33:05 pm
I definitively think that it would be nice to have a place where we can convert sprites to various format. Either we could bug Kerm so he adds more formats to Source Coder. It would be nice if we could have multiple formats, that's for sure, such as xLIBC. Currently, SourceCoder lacks certain formats such as xLIBC and 3-bit PRIZM pictures.

Else, a public domain calculator sprite database with various formats is a good idea, although I think it would be nice if they were also posted on Omni, so people don't miss out on them.
Title: Re: Open Sprite Library
Post by: flyingfisch on October 30, 2013, 12:45:43 pm
Else, a public domain calculator sprite database with various formats is a good idea, although I think it would be nice if they were also posted on Omni, so people don't miss out on them.

Hmm? I don't think I understand... what about posting on omni?


My idea is to have a one stop calc sprite database. The homepage would have a searchbar, and popular sprites below it. The search bar would be a live search, so that as you type the sprites are filtered.

When you click on a sprite, it takes you to a page with the sprites description, other sprites by the same author, and all the supported formats for the sprite, ready to copy/paste into your code.

This makes it easy both for artists and programmers. The programmers simply search for what they need, and the copy/paste the code. Artists only need to upload an image, and it is automatically converted to the various sprite formats.

I may also make a sprite requests section.

Any other ideas?
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on October 30, 2013, 01:02:33 pm
Well I mean if someone creates a brand new site to create a big sprites database, but nobody posts their creations in the pixel art sub-forum here as a result, it would suck, since many people might only check one site and miss their creations. Hence why it would be nice to suggest uploaders to share their creations on Omni/Cemetech/etc.
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 30, 2013, 01:57:44 pm
A possibility would be to link it in the Omni navbar.
Title: Re: Open Sprite Library
Post by: Sorunome on October 30, 2013, 02:07:03 pm
A possibility would be to link it in the Omni navbar.
speeking of which, the image uploader and the radio should be linked there >.<
Title: Re: Open Sprite Library
Post by: Streetwalrus on October 30, 2013, 02:07:50 pm
/me pokes admins about it
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on October 30, 2013, 04:08:25 pm
A possibility would be to link it in the Omni navbar.
speeking of which, the image uploader and the radio should be linked there >.<
And vice-versa. :P
Title: Re: Open Sprite Library
Post by: Juju on October 30, 2013, 04:15:29 pm
That would actually be a nice idea. People would upload their art in source format or in Axe format or whatever and people would download them converted in all the applicable formats, along with a HTML-generated preview. Can I help?
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on October 30, 2013, 04:42:29 pm
It would be cool if you could. Just keep in mind, though: For the time being, xLIBC only allows 128x64 sprite sheets and 80x60 background pics. As a result, converting an individual sprite is impossible.
Title: Re: Open Sprite Library
Post by: Streetwalrus on November 01, 2013, 01:29:56 pm
That would actually be a nice idea. People would upload their art in source format or in Axe format or whatever and people would download them converted in all the applicable formats, along with a HTML-generated preview. Can I help?
Hmm, I think more something like upload a PNG or a BMP.
Title: Re: Open Sprite Library
Post by: tpt1234567890 on November 01, 2013, 04:56:50 pm
That would actually be a nice idea. People would upload their art in source format or in Axe format or whatever and people would download them converted in all the applicable formats, along with a HTML-generated preview. Can I help?
Hmm, I think more something like upload a PNG or a BMP.

I think it should be either PNG, BMP, JPEG, or GIF images...
Title: Re: Open Sprite Library
Post by: Streetwalrus on November 01, 2013, 06:22:57 pm
Definitely not JPEG which is only for photos though GIF can be cool for animated sprites. They're not very convenient to make though so you might as well upload all the frames as a sprite sheet. But for the heck of it we should support all the widespread formats out there.
Title: Re: Open Sprite Library
Post by: flyingfisch on November 06, 2013, 10:42:55 am
OK, I am awaiting a reply from kerm.

It sounds like he'll give me the source code though. :)
Title: Re: Open Sprite Library
Post by: flyingfisch on November 09, 2013, 12:34:10 pm
OK, kerm says that his code would probably make my work harder as it isn't very well documented, so I am going to write my own code. :)
Title: Re: Open Sprite Library
Post by: flyingfisch on November 12, 2013, 06:24:21 pm

why does this SQL code throw an error instead of creating a table?

Code: [Select]
CREATE TABLE "sprites" (
            id int NOT NULL auto_increment,
            name varchar(30) NOT NULL,
            uploader varchar(30) NOT NULL,
            tags varchar(255) NOT NULL,
            date_uploaded datetime NOT NULL DEFAULT CURDATE(),
            luazm_data text NOT NULL,
            prizm_data_16bit text NOT NULL,
            PRIMARY KEY (id)
            );

I have determined that there is something wrong with CURDATE(), but I got that line from a w3schools tutorial so I think it should work?
Title: Re: Open Sprite Library
Post by: Sorunome on November 12, 2013, 06:27:24 pm
i thought it was only CURDATE, not CURDATE().
Also, maybe a key has a conflicting name?
Title: Re: Open Sprite Library
Post by: flyingfisch on November 12, 2013, 06:31:10 pm
Running it in PHPMyAdmin gives me this:
Code: [Select]
CREATE TABLE "sprites" (
            id int NOT NULL auto_increment,
            name varchar(30) NOT NULL,
            uploader varchar(30) NOT NULL,
            tags varchar(255) NOT NULL,
            date_uploaded datetime NOT NULL DEFAULT CURDATE,
            luazm_data text NOT NULL,
            prizm_data_16bit text NOT NULL,
            PRIMARY KEY (id)
            );

Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"sprites" (
            id int NOT NULL auto_increment,
            name varch' at line 1
Title: Re: Open Sprite Library
Post by: Adriweb on November 12, 2013, 06:45:47 pm
What about "NOW()" instead of CURDATE ?
Title: Re: Open Sprite Library
Post by: flyingfisch on November 12, 2013, 07:15:29 pm
NOW() and NOW also give the same error.
Title: Re: Open Sprite Library
Post by: Sorunome on November 13, 2013, 03:20:29 am
how about int(11) instead of int
Title: Re: Open Sprite Library
Post by: flyingfisch on November 13, 2013, 09:22:50 am
still have errors:

Code: [Select]
CREATE TABLE sprites (
            id int(11) NOT NULL auto_increment,
            name varchar(30) NOT NULL,
            uploader varchar(30) NOT NULL,
            tags varchar(255) NOT NULL,
            date_uploaded datetime NOT NULL DEFAULT CURDATE(),
            luazm_data text NOT NULL,
            prizm_data_16bit text NOT NULL,
            PRIMARY KEY (id)
            )

Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(),
            luazm_data text NOT NULL,
            prizm_data_16bit ' at line 6


BTW, MySQL error reporting is even worse than PHP's. :(
Title: Re: Open Sprite Library
Post by: Adriweb on November 13, 2013, 09:26:39 am
try without these other datatypes, just to see ? (lua*)
Title: Re: Open Sprite Library
Post by: flyingfisch on November 13, 2013, 09:29:24 am
No errors with this:

Code: [Select]
CREATE TABLE sprites (
            luazm_data text NOT NULL
            )

This does give an error though:
Code: [Select]
CREATE TABLE sprites (
            date_uploaded datetime NOT NULL DEFAULT CURDATE()
            )

Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE()
            )' at line 2


EDIT:
Figured it out. With MySQL, in every case other than CURRENT_TIMESTAMP, the default value has to be constant.
http://dev.mysql.com/doc/refman/4.1/en/data-type-defaults.html

So this works:
Code: [Select]
CREATE TABLE sprites (
            date_uploaded TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
            )
Title: Re: Open Sprite Library
Post by: flyingfisch on November 13, 2013, 12:09:20 pm
OK, asking the community a question here:

Would it be more convenient for you if Open Sprite Library used OpenID, so you can login with Google or Facebook, or would you rather that I implemented a built-in login system?
Title: Re: Open Sprite Library
Post by: Sorunome on November 13, 2013, 12:14:29 pm
I would prefer a built-in system as I do not like logging in with other accounts somewhere.....I prefer having many accounts :)
Title: Re: Open Sprite Library
Post by: flyingfisch on November 13, 2013, 12:17:46 pm
I would prefer a built-in system as I do not like logging in with other accounts somewhere.....I prefer having many accounts :)

Well that makes 2 of you, you and Kerm. So I guess I will implement a login system unless I get opposition. :)
Title: Re: Open Sprite Library
Post by: Streetwalrus on November 13, 2013, 01:21:38 pm
Yeah I prefer sites to use their own account system. ;)
Title: Re: Open Sprite Library
Post by: Sorunome on November 13, 2013, 01:55:14 pm
How about you make that you have to have an google+ account to be able to view the pics, seing that youtube can pull such stuff off for comments/me hides due to sarcasm
Title: Re: Open Sprite Library
Post by: flyingfisch on November 13, 2013, 09:27:19 pm
OK, the login system is implemented, and the url is now http://osl.cemetech.net (thanks Kerm!).

Todo:
- Comment system
- Custom search engine
- Most of the front-end
- Adding more sprite formats than luazm and Prizm C 16 Bit


If you want to try out the site, that's fine, just be aware that it is currently in an alpha state, and the database may be reset at any time.

Register: http://osl.cemetech.net/login.php
Upload Sprites: http://osl.cemetech.net/uploadsprite.php
Test Page (check this out for sneak peaks on what I am currently working on ;)): http://osl.cemetech.net/test.php
Login: http://osl.cemetech.net/login.php
View uploaded sprites: http://osl.cemetech.net/viewsprite.php?id=<sprite id> (try 1 and 2, when more sprites are uploaded, try others. It does not fail very gracefully though.)
Title: Re: Open Sprite Library
Post by: Sorunome on November 14, 2013, 10:40:55 am
(you may want to edit your post to link to the real register page :P )
Also, yay, gravatar :P
And I never got a verification email.....

anyways, it is looking nice so far! (yay, i got user id 2)
Title: Re: Open Sprite Library
Post by: Eiyeron on November 14, 2013, 02:33:05 pm
Meh, that (http://osl.cemetech.net/register.php) was easy to find! :p

Damnit, failed the spambot detection. TI stands for Titanium too!

Error on uploadsprite.
Title: Re: Open Sprite Library
Post by: flyingfisch on November 14, 2013, 02:38:52 pm
(you may want to edit your post to link to the real register page :P )
Also, yay, gravatar :P
And I never got a verification email.....

anyways, it is looking nice so far! (yay, i got user id 2)

umm, no email verification, the question is enough i think. Though maybe I should have a welcome email sent...
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on November 14, 2013, 10:30:01 pm
I tried this and it's pretty cool. It might be a good idea to rephrase the e-mail validation thing so that we don't think we're supposed to get an e-mail, though, although I guess in its current form, the message might at least discourage people from using fake e-mails.
Title: Re: Open Sprite Library
Post by: flyingfisch on November 15, 2013, 09:14:07 am
I tried this and it's pretty cool. It might be a good idea to rephrase the e-mail validation thing so that we don't think we're supposed to get an e-mail, though, although I guess in its current form, the message might at least discourage people from using fake e-mails.

Well, the email needs to be valid for the "Forgot Password" function which i have yet to implement.

Thanks for the feedback guys, I'll try to keep up work on this :)

EDIT:
Have to work on comments, need to make more sprite generators. Besides that, this project is almost finished. Please report bugs!

I am thinking of making an API so that other sites can integrate with OSL, what kind of functions would you like? I was thinking one that would return an XML of all search results given a query would be good, let me know. :)
Title: Re: Open Sprite Library
Post by: Xeda112358 on November 15, 2013, 11:32:46 am
I keep getting "400 Bad Request" :/
Title: Re: Open Sprite Library
Post by: flyingfisch on November 15, 2013, 11:54:36 am
Do you still get it? Maybe you were trying to access a page I was working on or something...
Title: Re: Open Sprite Library
Post by: Xeda112358 on November 15, 2013, 12:04:51 pm
I am still getting the error, on each page. The rest says, "Your browser sent a request that this server could not understand."
Title: Re: Open Sprite Library
Post by: flyingfisch on November 15, 2013, 01:57:14 pm
I am still getting the error, on each page. The rest says, "Your browser sent a request that this server could not understand."

According to Kerm, this is a problem with cemetech's cookies. Try using this address until he fixes it: openspritelibrary.tk
Title: Re: Open Sprite Library
Post by: Yeong on November 15, 2013, 02:56:32 pm
Created account and uploaded something to test. (It seems like it doesn't support BMP format though.)
Title: Re: Open Sprite Library
Post by: DJ Omnimaga on November 15, 2013, 10:47:24 pm
BMP is obsolete, though. Aside from monochrome color depth, which can be handy for providing very small calc screenshots (even more than GIFs and PNGs), BMP is just ridiculously large for any kind of image sharing and is heavily discouraged.
Title: Re: Open Sprite Library
Post by: flyingfisch on November 16, 2013, 08:34:53 am
Yes, at this point at least, PNG is the only supported image format.

I will be gone for most of today, but what I need now is a PHP function to convert 24-bit RGB (as inputs $r, $g, $b) to grayscale. If someone could write one for me (or google it for me) I'd appreciate it. See ya all either later today or tomorrow.
Title: Re: Open Sprite Library
Post by: Eiyeron on November 23, 2013, 04:00:14 am
I started populating it with my sprites, and it won't get my font image, which is 64*64.
Will you plan to add a kind of sprite sheet?
Title: Re: Open Sprite Library
Post by: Streetwalrus on November 24, 2013, 02:59:18 am
Yeah uploading sprite sheets is a must IMO.
Title: Re: Open Sprite Library
Post by: Sorunome on December 02, 2013, 01:21:04 pm
You should look into the max cookie length accepted, today i had to clear all my cookies on *.cemetech.net because osl refused my connection due to sending too many cookies.
Title: Re: Open Sprite Library
Post by: Eiyeron on December 02, 2013, 02:00:46 pm
That, and exporting for Axe and z80Asm (and I don't even talk for n-bits export)
Title: Re: Open Sprite Library
Post by: ben_g on December 02, 2013, 02:37:13 pm
I will be gone for most of today, but what I need now is a PHP function to convert 24-bit RGB (as inputs $r, $g, $b) to grayscale. If someone could write one for me (or google it for me) I'd appreciate it. See ya all either later today or tomorrow.
isn't converting to greyscale as simple as just calculating the average of the r, g and b values?
Title: Re: Open Sprite Library
Post by: Eiyeron on December 02, 2013, 02:40:02 pm
No, some colors are visibly less visible than others. Yellow is less visible than magenta or cyan for instance.
Title: Re: Open Sprite Library
Post by: NanoWar on February 13, 2015, 08:22:11 pm
Sorry to necro post, but I just read this topic, went (first page mention) to http://opengameart.org/ and saw a calculator 8x8 sprite dungeon by Eiyeron and just wanted to say that it's pretty funny! :D

(http://opengameart.org/content/8x8-4-gray-dungeon-set)