pantel05

Hey guys, question about Photoshop to spine script,
When I use the script to generates the images, all images are very heavy and huge sizes !
If I use the "traditional" way ( export as png) the images are dramatically smaller with same quality !
of course this doesn`t matter because the final export is typical atlas png and smaller size.

However, I compared the exif - metadata images and I found too many lines (100+) in tag Document Anchestors, like the screenshot, I found what exactly is this, but my question is simpler.
Is that possible in future script update do not include this information ?

*sorry if this post is in the wrong place
Nemaš dopuštenje za pregledavanje privit(a)ka dodan(og)ih postu.
pantel05
  • Postovi: 4

Erika

Hello, could you send us a file that can reproduce the problem, and maybe also one of the exported files so we can look at the metadata to contact@esotericsoftware.com for reproduction purposes?
Avatar
Erika

Erikari
  • Postovi: 3068

pantel05

Thank you Erika, I already sent the mail with attachments.
Thank you again
pantel05
  • Postovi: 4

Nate

We got the PNG files, thanks. You can see the savePNG function in the script:
function savePNG (file) {
var options = new PNGSaveOptions();
options.compression = 6;
activeDocument.saveAs(file, options, true, Extension.LOWERCASE);
}
This is supposed to be roughly equal to "save as, PNG". That Photoshop adds a ton of XML is terrible, but it's a Photoshop problem with this kind of saving, so there's nothing we can do to avoid it.

We could do a different kind of saving. We used to actually, then we changed it to "save as" but I don't remember the reasons why. If you want to use "save for web" instead, change the function to this:
function savePNG (file) {
var options = new ExportOptionsSaveForWeb();
options.format = SaveDocumentType.PNG;
options.PNG8 = false;
options.transparency = true;
options.interlaced = false;
options.includeProfile = false;
activeDocument.exportDocument(file, ExportType.SAVEFORWEB, options);
}
However, why is this important to fix? Spine reads your image files and ignores the Photoshop XML junk. When Spine packs a texture atlas, the PNGs it creates don't have such junk.

I suggest using Oxipng if you care about PNG file sizes. No software, even Spine, is going to write the smallest PNGs possible. We may integrate Oxipng in the future, so Spine exports can use it. See here:
Exported PNG file size too big using script

---

Actually looking in the script's Git history, it was "save as" since the first commit. I've updated to the script to use "save for web", let's see how that goes!
Avatar
Nate

Nate
  • Postovi: 11875

pantel05

Thank you Nate for your reply !
Yes !
I changed the function as you suggested and works fine!
so, the reason for this changes is simple, because we are working remotely, all team share files vie server, and all those images are 10 times slower to upload, btw, now we are ok !

Thank you, for this solution !
pantel05
  • Postovi: 4


Natrag na Bugs