# Saving species in an image file

**URL:** https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870
**Category:** Programming
**Created:** [April 17, 2022, 3:06pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870 "2022-04-17T15:06:40Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:06pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/1 "2022-04-17T15:06:40Z")

</div>

About the image saves another game I’ve modded and really broken the save format for is Cosmoteer. It does this in an interesting way. I also have code that already replicates its save system: [Cosmoteer: StarWright - Steganography](https://blog.cosmoteer.net/2012/01/starwright-steganography.html)

And about that last bit: I’m worried I can make it fast enough, but only on computers with a GPU.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [April 17, 2022, 3:08pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/2 "2022-04-17T15:08:06Z")

</div>

That’s the other possible approach, using the pixels to store data. That will also entirely break if the image is resized or re-encoded so that the quality is lowered.

Edit: the first approach I mentioned here: [Release planning for 0.5.9 (and 0.5.8.1) - #16 by hhyyrylainen](https://forum.revolutionarygamesstudio.com/t/release-planning-for-0-5-9-and-0-5-8-1/868/16)

---

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:09pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/3 "2022-04-17T15:09:22Z")

</div>

That tends to be better as most sites completely strip metadata, but its rare that the image data is edited unless you do it intentionally.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [April 17, 2022, 3:11pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/4 "2022-04-17T15:11:08Z")

</div>

I beg to differ as most images shared online I see have had a ton of compression applied to them. But anyway we should probably get back on topic or split to a different thread if we want to continue talking about this.

---

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:12pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/5 "2022-04-17T15:12:18Z")

</div>

Split it (I would but don’t know how)

---

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:14pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/6 "2022-04-17T15:14:09Z")

</div>

I at least know for that game, that the images shared on discord are left intact.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [April 17, 2022, 3:14pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/7 "2022-04-17T15:14:49Z")

</div>

Well discord doesn’t seem to re-encode images or videos. But most (if not all) general most popular image sharing sites will re-encode images.

---

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:16pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/8 "2022-04-17T15:16:03Z")

</div>

If we are doing this though, I feel those sites will also strip metadata. I think that is a sacrifice you have to accept if you want saves like this.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [April 17, 2022, 3:18pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/9 "2022-04-17T15:18:05Z")

</div>

My point was that the metadata or append data at the end approach is probably as good as the encoding data in pixels. And the approach of appending data won’t have size limitations, which is why I think it’s the best approach.

---

<div class="post-metadata">

### Author: ![Gamedungeon](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/gamedungeon/32/2202_2.png) [@Gamedungeon](https://forum.revolutionarygamesstudio.com/u/Gamedungeon)
#### Post date: [April 17, 2022, 3:19pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/10 "2022-04-17T15:19:56Z")

</div>

I’m not 100% if this is the same thing, but discord strips exif data from photos.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [April 17, 2022, 3:24pm UTC](https://forum.revolutionarygamesstudio.com/t/saving-species-in-an-image-file/870/11 "2022-04-17T15:24:02Z")

</div>

Yeah, that’s pretty standard to not leak people’s home GPS coordinates. I’m not sure if there’s some other metadata or if that’ll get rid of all metadata. Anyway I think the append random data at the end is the way to go. With the pixel based approach the created image needs to be able to scale up and up as there’s more data. I haven’t checked but our data saving needs might at some point exceed the 100 kb that game you linked is able to save in their 500x500 images.
