Quantcast

What works and what is paused · Email is limited to account activation and password resets.

Jump to content


Photo

Flight Rising Item Database


  • Please log in to reply
50 replies to this topic

#26 Eefi

Eefi
  • 1337 h4x0r

  • 1626 posts


Users Awards

Posted 06 July 2014 - 05:40 AM

Absolutely should be. I bet there's algorithms out there to do exactly that in PHP. You may have trouble on the apparel, though, because of the background dragons.

PHP is nice for building websites but I wouldn't do any image processing in PHP if I have a choice xD

 

 

It's pretty simple stuff, just histogram, sort and threshold the colours. ;) As for the background dragons, I'm not entirely sure what the images look like since I've never been on Flight Rising but if the background images always the same you can just subtract them and that'll remove them entirely.

How to explain. I imagine people would like to use this feature to find matching familiars for their dragons. Each individual dragon has 3 colors (primary, secondary, tertiary) that come from a fixed color palette. What I wanted to do is compute a histogram using this color palette as bins.

As @Sweeney has already tried removing the background from apparel preview images, it won't be perfect but it's probably good enough for this case, so I'll do that. ^^



Advertisement

    #27 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 06 July 2014 - 05:44 AM

    How to explain. I imagine people would like to use this feature to find matching familiars for their dragons. Each individual dragon has 3 colors (primary, secondary, tertiary) that come from a fixed color palette. What I wanted to do is compute a histogram using this color palette as bins.

    As @Sweeney has already tried removing the background from apparel preview images, it won't be perfect but it's probably good enough for this case, so I'll do that. ^^

     

    If I'm understanding what you're planning to try properly the problem you might have with that is if any of the colours of the parts you want to analyse overlap with the palette colours of the bits you don't.



    #28 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 06 July 2014 - 05:46 AM

    If I'm understanding what you're planning to try properly the problem you might have with that is if any of the colours of the parts you want to analyse overlap with the palette colours of the bits you don't.


    Yup.

    Also, some of the apparel has semitransparent parts which, when overlaid on the background displays, will mess up the colour profile.

    #29 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 06 July 2014 - 05:56 AM

    Yup.

    Also, some of the apparel has semitransparent parts which, when overlaid on the background displays, will mess up the colour profile.

     

    Depending on how transparent they are that might not be too much of an issue, the most transparent parts are the bits which people wouldn't be interested in getting the colour of anyway.



    #30 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 06 July 2014 - 06:03 AM

    Depending on how transparent they are that might not be too much of an issue, the most transparent parts are the bits which people wouldn't be interested in getting the colour of anyway.


    Yeah, true. The backgrounds are all neutrally coloured anyway.
    I guess we'll see how Eefi works it out :p

    Speaking of which, do you want my background dragon images, Eefi?

    #31 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 06 July 2014 - 06:08 AM

    Speaking of which, do you want my background dragon images, Eefi?

    If you want to send me those, sure xD So far I've only saved gray colored dragons that I display for my accent previews.



    #32 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 06 July 2014 - 06:13 AM

    If you want to send me those, sure xD So far I've only saved gray colored dragons that I display for my accent previews.


    Yeah, I used photoshop to smush together the background images from a bunch of apparel to get a complete "ghost" :p
    I'll PM them over.

    #33 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 07 July 2014 - 08:25 AM

    Massive thanks to @Satsuki and @Chappy for submitting info :3!!

     

    I've cleaned up Accents and Skins by setting all those that have no distrinct item description to "Private". If you look at the "Items missing data" list, it's about half the size now! Some skins/accents may be misclassified, however. If you notice something, just submit a modification ^^

     

    The color extraction for Familiars/Skins/Accents/Apparel is harder than I thought. =__=" If I classify all pixels to the FR color palette and use the top 3, it doesn't really reflect the colors you would choose as a human. Say, a familiar is mostly in blue-ish shades and has a few pink spots. Then the extracted colors will be all blue and stuff like that. Sometimes I also don't understand why the script chooses a certain color xD


    Edited by Eefi, 07 July 2014 - 08:25 AM.


    #34 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 07 July 2014 - 08:29 AM

    The color extraction for Familiars/Skins/Accents/Apparel is harder than I thought. =__=" If I classify all pixels to the FR color palette and use the top 3, it doesn't really reflect the colors you would choose as a human. Say, a familiar is mostly in blue-ish shades and has a few pink spots. Then the extracted colors will be all blue and stuff like that. Sometimes I also don't understand why the script chooses a certain color xD

     

    What do the images actually look like?



    #35 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 07 July 2014 - 10:41 AM

    What do the images actually look like?

    I host all the images in google drive folders, that are publicly accessible. Here's the folder for familiars: https://googledrive....dVVzWUZtXzRPMm8

    There's no hard criteria what colors I should display for a picture :/ But e.g. here, I think you'd want the red too:

    3643.png



    #36 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 07 July 2014 - 10:53 AM

    I host all the images in google drive folders, that are publicly accessible. Here's the folder for familiars: https://googledrive....dVVzWUZtXzRPMm8

    There's no hard criteria what colors I should display for a picture :/ But e.g. here, I think you'd want the red too:

    3643.png

     

    Could you take the mode and then isolate any other colour that appears above a certain percent and is a certain difference from the mode?



    #37 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 08 July 2014 - 09:59 AM

    What I would look to do is to cluster the colours. So you'd run through each of the pixels, find how many of the other pixels are within X distance of the colour of that pixel and if it's above a certain threshold consider that as a cluster point (then use the existing cluster points to exclude any similar colours). There should already be algorithms out there to do k-means clustering for you which should be fairly quick.


    I've got it quite close to acceptable, so here's the results for a few of the images:

     

    3643.png8CktPmW.png

     

    1221.pngPmWftaE.png

     

     

    1173.pngLHTKMgw.png

     

    1145.pngqDXmF8Y.png

     

    1034.png4lsftdB.png

     

    1564.pngnNTx66m.png



    #38 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 08 July 2014 - 10:14 AM

    What I would look to do is to cluster the colours. So you'd run through each of the pixels, find how many of the other pixels are within X distance of the colour of that pixel and if it's above a certain threshold consider that as a cluster point (then use the existing cluster points to exclude any similar colours). There should already be algorithms out there to do k-means clustering for you which should be fairly quick.


    I've got it quite close to acceptable, so here's the results for a few of the images:

    Oh nice!!

    Yes, I've used k-means too. ^^ One of the last problems I had was that I wanted to map those colors to the FR palette and that didn't work with euklidian distance at first.  Will upload the calculated colors for the familiar set soon~

     

    Out of curiosity, your approach was using a color difference threshold, how did you define it?


    Edited by Eefi, 08 July 2014 - 10:15 AM.


    #39 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 09 July 2014 - 08:02 AM

    I actually didn't bother with using k-means in the end because I figured out a simpler way then I borrowed the colour difference algorithm from my Mystery Pic script and used that to threshold the colours.

     

    As for the euclidean distance bit, you should try using a different colour space than the normal RGB because it doesn't fit with visual perception of colours. ;) I find Lab is much better.


    @Eefi, did you manage to get yours working as you need now?



    #40 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 09 July 2014 - 08:46 AM

    I actually didn't bother with using k-means in the end because I figured out a simpler way then I borrowed the colour difference algorithm from my Mystery Pic script and used that to threshold the colours.

     

    As for the euclidean distance bit, you should try using a different colour space than the normal RGB because it doesn't fit with visual perception of colours. ;) I find Lab is much better.


    @Eefi, did you manage to get yours working as you need now?

    I came to the same conclusions as you xD and made the switch to Lab color space.

    Yeah, it works okay now, I still need to fix automatic updating of new items first before I can insert the extracted colors but I'm getting there. ^^

     

    Whee, I can display colors for familiars now! Still have to think about how to make an useful search option for it.

     

    Spoiler

    Edited by Eefi, 09 July 2014 - 12:45 PM.


    #41 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 09 July 2014 - 12:47 PM

    Whee, I can display colors for familiars now! Still have to think about how to make an useful search option for it.

     

    How about a colour picker so they can pick X colours and it'll return them ordered by how closely they fit the selected ones?



    #42 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 09 July 2014 - 02:17 PM

    How about a colour picker so they can pick X colours and it'll return them ordered by how closely they fit the selected ones?


    Ding. Exactly this, @Eefi.
    I'd make the display of colours way less prominent, too :p Maybe small boxes under the image display.

    #43 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 20 July 2014 - 11:30 AM

    Ding. Exactly this, @Eefi.
    I'd make the display of colours way less prominent, too :p Maybe small boxes under the image display.

    Uh, a color picker is really elaborate. Maybe there are javascript applets or something that I can use. There's also the problem that a familiar has multiple colors, how to make a search that can cover that without making it too complicated?

     

    I'll worry about the color display later since I'm not really happy with the item details page anyway. Right now I just want to show everything that I have and focus on getting all the information in there first.

     

    There have been several things I included in the meantime:

    - Updated items again (there are a ton of text scrap items now!)

    - Automatic insertion of swipp trading items

    - Display a little link to the correct page of the FR Wiki for contributors to make manual lookup a bit easier

     

    Soon:

    - Colors for apparel, skins, accents

    - Accent preview on your own dragons



    #44 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 20 July 2014 - 11:33 AM

    Uh, a color picker is really elaborate. Maybe there are javascript applets or something that I can use. There's also the problem that a familiar has multiple colors, how to make a search that can cover that without making it too complicated?

     

    Have you tried the html color input type? ;)

     

    http://www.w3schools...nput_type_color



    #45 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 20 July 2014 - 11:37 AM

    Have you tried the html color input type? ;)

     

    http://www.w3schools...nput_type_color

    Didn't know there was something like that.. orz

    The example you linked looks like a text field to me. I should really update my Iceweasel =_= brb



    #46 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 20 July 2014 - 11:40 AM

    Didn't know there was something like that.. orz

    The example you linked looks like a text field to me. I should really update my Iceweasel =_= brb

     

    It's a part of HTML5 and was introduced early last year I think so it should work for the majority of people by now. ;) If not there are definitely javascript alternatives out there.



    #47 Guest_Kate_*

    Guest_Kate_*

    Posted 20 July 2014 - 11:45 AM

    This is awesome! Well done @Eefi :)



    #48 Eefi

    Eefi
    • 1337 h4x0r

    • 1626 posts


    Users Awards

    Posted 07 August 2014 - 08:55 AM

    Great fun! Google took my images down, I believe Flight Rising or some other report happy people have notified them. Does anyone know of a good image host? I must be able to automatically upload them (e.g. FTP, SCP) and it shouldn't rename my files. Otherwise, I'll host them on my own server but it's a whole bunch of files...



    #49 Waser Lave

    Waser Lave
    • 25516 posts


    Users Awards

    Posted 07 August 2014 - 09:18 AM

    Great fun! Google took my images down, I believe Flight Rising or some other report happy people have notified them. Does anyone know of a good image host? I must be able to automatically upload them (e.g. FTP, SCP) and it shouldn't rename my files. Otherwise, I'll host them on my own server but it's a whole bunch of files...

     

    I think ImageVenue has FTP uploading but I don't know much else about them.



    #50 Dan

    Dan
    • Resident Know-It-All

    • 6382 posts


    Users Awards

    Posted 07 August 2014 - 09:45 AM

    Great fun! Google took my images down, I believe Flight Rising or some other report happy people have notified them. Does anyone know of a good image host? I must be able to automatically upload them (e.g. FTP, SCP) and it shouldn't rename my files. Otherwise, I'll host them on my own server but it's a whole bunch of files...

     

    How many files and what's the total size?

     

    How were you hosting them before?




    1 user(s) are reading this topic

    0 members, 1 guests, 0 anonymous users