16:40 ST
Reply
Reworking Mycena Cave image generation
Image Generation from the Ground Up

I’m extremely excited to announce the completion of a project that has basically sucked down every waking hour since I started it several weeks ago. And that is this: a complete overhaul of the Mycena Cave Image Generation code. This is the code that underpins all Mycenian images, geness images, avatar images, the magic puddle, and so on.

 

What’s new?

Previously we used a library called ImageMagick to perform layering operations, hue shifts, and so on. That itself was an improvement in speed and image quality over our initial work and has served us well since December of 2013, but has had its own fair share of warts. This time we’re eschewing libraries altogether in favor of getting our hands dirty and working the images manually. This has two benefits

 

Speed

First, speed: this new thing is fast. Blazingly fast. I wrote it from the ground centered around getting an image out the door as fast as computationally possible, and it paid off. On average, the new system will generate a Mycenian image four to five times faster than what we’ve been using so far: a Mycenian with a reasonable number of items equipped might previously have taken around 2.5 seconds to render can now be generated in about 0.6 seconds.

This is particularly noticeable in the “Manage Pet” interface, when you’re sorting, enabling, or disabling layers. Each change you make needs to re-load the image, which would take several seconds before Mycena Cave could even begin to transmit it to you. This interface will now be a lot snappier.

Flexibility

By avoiding shunting the image processing to pre-existing software and performing image operations ourselves (as it turns out, there is a surprising amount of interesting math going on even in simple operations like “put one layer on top of another”), we gain the flexibility of being able to do… well… anything we want. As a prime example, consider shifting colors.

Years ago when we first introduced the Driftshroom (which performs a hue shift on your Mycenian), we meant it as kind of a joke item — a kind of “look what we can do!”. We were so amused by the fact that we could that we never really stopped to think whether we should. While it can result in some neat effects, the results often end up looking garish, inverting shadows and highlights and generally looking “wrong”.








A similar thing is true with the desaturation mechanic of the Gloomshroom, which tends to mess with the contrast of a Mycenian, instead of just “sucking out the color” like we are able to do now.

We know many of you love your current drifts, so we will be keeping the current Driftshroom mechanic — your drifted pets aren’t changing out from under you. We haven’t yet determined exactly how we’ll release this new color shifting mechanic, but we’re very pleased with the expanded flexibility of our image generation, and you can expect to see the new color shifting (as well as potentially other cool features) to become available soon.

All in all, the new image generation code will help with image loading speed and increase flexibility of image manipulations of pets which will open new possibilities of making your pet more unique. We hope you’ll enjoy the updates!

Posted Jan 18, edited Jan 18

:O MAGIC

Honestly this is so cool :D I can’t imagine the kind of work it’s taken you to do an in-house image code. Thanks for telling us all about it!

Posted Jan 18
I don’t have any drifted pets, but this improved ‘magic’ looks like it could be an incentive to try a hue shift. Thanks for the hard work you put into all this code, looking forward to the release! :>
Posted Jan 18

How interesting. I have to say, I never really noticed how differently the drifted pets appeared detail-wise, even being one so addicted to drifters as I am. I just kinda figured that the details lost were because the colors were too similar and that I’m not good at distinguishing those details. If this turns into having retro vs new drifty capability on pets, I’d be so down for that. There are drifts I don’t want to change and ones I’d love to see with the new rendering. Although if we did have a way to preview how differently the new look would be on drifted pets via the Puddle, I’d appreciate that before anything changed. I’m assuming that this would be so?

I’m looking forward to the new changes, regardless.

Posted Jan 18
Genius coder success! Thanks so much for the hard work. I’m super excited for the possibilities with this.
Posted Jan 18

Oh my GOOOOOSSSSSHHHH I am gonna be nugget poor forever........... the Magic effects are BEAUTIFUL and I am so curious to play with the effects.

Can it be added to Magic Puddle at some point, even if you haven’t decided how to introduce the effect yet? I really really really wanna play with how my pets are gonna look!!

Posted Jan 18

The previews look very good, I’m looking forward to the “potentially other cool features” that are mentioned c:
Thank you for preserving the current Drift mechanic!
So the new system will only affect drifted pets, or will it change the appearance of undrifted pets in any way?

Posted Jan 18
This looks great! There are some colors i think would have a lot of potential for drifting, so to see the ‘magic’ versions is really cool!
Posted Jan 18, edited Jan 18
Ooo! Looks super cool!! Although you’ve broken the gloomshroom and the gloomers currently xD I’m really hype for the magic drift, it looks gorgeous!
Posted Jan 18

Chiming in to second the Gloomshroom stuff, i.e. Percy.

But very cool and I suddenly have a feeling I don’t have anywhere near enough Gloomshrooms or Driftshrooms saved up now. <<

Posted Jan 18
hhhhhhhhhh that magic Crystal Catalyst looks so GOOD. Dang I wish I had driftable pets.
Posted Jan 18
Wow. Just… wow.
Posted Jan 18
This sounds amazing and I can’t wait to see the new MAGIC that goes on. Am curious if this means more ‘drifty’ items too.
Posted Jan 18

Sooo… Some of my pets are displaying in grayscale currently, but only when I click to their individual profiles (they appear normal on my main profile page.) Is that part of this? (None of the ones affected have drift/gloom shrooms applied.)

Edit: Affected pets are Illociel, Avery, and Naia

Oh! And Silhouette is showing up in grayscale on her profile and on my main profile. :P

Posted Jan 19, edited Jan 19

You love trying to make my guides redundant, don’t you, glitch?

In all seriousness, this update is really neat, even if it does make my life a little more difficult. I’d noticed that some of the coats just drifted way more brightly than the base coat, so I’m glad that’s being addressed

E: I’m apparently experiencing the same problems as WindyFox, because my avatar isn’t meant to be grey.

Posted Jan 19, edited Jan 19
Hah!  Thirding the amusing greyscale drift problem, lovely though the effect is!
Posted Jan 19
Any pet whose image gets refreshed seems to go to 0 saturation, oh no.
Posted Jan 19
Whoops, sorry about that — looks like I had gloom on backwards.
Posted Jan 19

I found another glitch! My av bg is supposed to be “Sweet Dreams” xD
~sweet dreams are made of gays~

Edit: oh look it’s already fixed. Damn now no one gets to appreciate my humor xD

Posted Jan 19, edited Jan 19

Thank you for keeping the original mechanic for now. I have a hard time imagining what other drifts would look like under the “magic” version compared to normal drifts (it looks like it does something like darken the outlines more or apply slightly different shifts to the base/highlights/shadows?) and appreciate being given a bit more options to choose with teh changes.

I’m also stoked that dressup is faster!

Posted Jan 19

Jacq I have figured out how to mock the magic drifts myself, so I should have the updated drifts up alongside the regular ones in a day or two :D

glitch While I’m busy doing this, will the drifty items also be put under the ‘magic’ drifts, or will they stay as-is?

Posted Jan 19

Jacq Hyasynthetic it’s basically performing transformations into and out of a variant of CIELAB called CIELCH — the basis is that unlike RGB/HSL/HSV/CMYK/etc., changing the chroma or hue should not alter the perceived luminosity. Some art programs can perform this transformation as well (I believe in Photoshop it is referred to as ‘lab mode’), but if you need the actual formulae you can find them here — just make sure you first convert the RGB images into linear-RGB or you’re going to have a bad time :|

The image generation code currently treats each Mycenian as its own colorspace entity — currently any drifty items equipped to a Mycenian will drift in the same manner.


Edit: as a side-effect from doing this I also now know a lot more about color spaces and transformations than I ever thought I would, or than I ever wanted to for that matter ;)

Posted Jan 19, edited Jan 19

Erm. Sprouts seem to be kind of broken right now. Mine is showing as a broken image link. D:
brokennnn ;;;;

Posted Jan 19
Thanks for the heads up! Flowers are back :)
Posted Jan 19

Ooh, interesting! I’ll have to do some more research on that later.
And thank you for the clarification of the items!

I’ve managed to get close-enough-for-guide-purposes through the use of a bit of patience and colour overlay layers, which is at the very least a facsimile of the new system (Keeping the luminosity of whatever’s below it, in this case, an unmodified version of the pet.) It was consistent on all the pets I tested it on, and this way, I don’t have to mess around with formulae I don’t understand.

Posted Jan 19

If anyone is wondering how to preview on their own, here are two methods to do it! Unfortunately I don’t believe CSP or SAI 1/2 have the capability to do the new magic previews, but Glitch just figured out how to preview them on GIMP, which is free (and also super simple)!

Photoshop

1. Change to Lab Color by going to Image > Mode > Lab Color
2. Hue slide as you would normally (Ctrl + U, or Image > Adjustments > Hue/Saturation)
3. Change the image mode back to RGB if you’re saving as a png!

GIMP

1. Go to Colors > Hue-Chroma and use the Hue slider
2. Save as png by going to File > Export as; png should be default!

Posted Jan 19, edited Jan 19

Uhm my avatar background is currently somehow one I don’t even own? I didn’t even change it from black so idk what’s going on.

Edit: actually it’s kind of random. I had seen it with the rainbow one at first but after drifting and glooming and then undoing the drift it’s a different avatar background. I don’t think I own this one either though.

Edit 2: Drifting and glooming Vera just broke her geness image.

Edit 3: After a spate of further testing with Briar, I’ve determined that Briar and Aucos’ geness image remains broken even after I swap her back to normal for either or both values. On the bright side all that testing made the avatar go back to the right background. I did take screenshots though if you need to see them.

Edit 4: So uhm does by any chance the changes mess with the shading because I think Briar looks a touch more…saturated ish? Than she used to.

Edit 5: glitch did you do something to the shading and highlight layers?

Posted Jan 19, edited Jan 19
Holy cow those magic drifts are well… Magic!! I love them so much more now!
Posted Jan 19
I wanted a driftshroom before, but wow I want one a lot more now! <3
Posted Jan 19
Lala your geness image was broken because it turns out all geness images were broken for a couple hours last night. That’s been fixed :) There have been no changes to the current drift mechanic, saturation, or any layers. I haven’t yet gotten to the bottom of the mystery avatar background switching yet, but you aren’t the only person this has happened to so hopefully we’ll sort it out relatively quickly.
Posted Jan 19
Reply