PNG quality with 30% size using JCC + a trick
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
- jack_norton
- Lemma-Class Veteran
- Posts: 4087
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
PNG quality with 30% size using JCC + a trick
I post this here even if I'm not sure if is the right forum. Anyway been tallking with some indies on twitter having the problem of distribution size. When you start having 40+ characters sprites with 1024px of height like in Loren, becomes problematic.
The solution is simple, use JCC with a trick.
Some people complained that the resulting image of JCC is poor quality, blurred. Yes, personally is hard to notice and depends on the image, but the problem is that the library used (PIL) does a poor job. Even setting the MAX quality, the resulting image can be blurry in some areas/colors.
Solution? first use that and then manually export with photoshop (or another good art program) the image from PNG to JPG, overwriting the .base.jpg image resulted from the JCC split (the other image mask.jpg is the alpha channel info and doesn't need to be changed).
Result: 100% quality (if you save as max quality in photoshop the image will be IDENTIC) but 30-40% size depending on the image. Even the best PNG shrinker programs can reduce max of 20-25%, while here you get a reduction of 60%!
The solution is simple, use JCC with a trick.
Some people complained that the resulting image of JCC is poor quality, blurred. Yes, personally is hard to notice and depends on the image, but the problem is that the library used (PIL) does a poor job. Even setting the MAX quality, the resulting image can be blurry in some areas/colors.
Solution? first use that and then manually export with photoshop (or another good art program) the image from PNG to JPG, overwriting the .base.jpg image resulted from the JCC split (the other image mask.jpg is the alpha channel info and doesn't need to be changed).
Result: 100% quality (if you save as max quality in photoshop the image will be IDENTIC) but 30-40% size depending on the image. Even the best PNG shrinker programs can reduce max of 20-25%, while here you get a reduction of 60%!
Re: PNG quality with 30% size using JCC + a trick
It's because Photoshop disables JPEG's chroma subsampling at high quality levels which is the cause of the blur.
- jack_norton
- Lemma-Class Veteran
- Posts: 4087
- Joined: Mon Jul 21, 2008 5:41 pm
- Completed: Too many! See my homepage
- Projects: A lot! See www.winterwolves.com
- Tumblr: winterwolvesgames
- Contact:
Re: PNG quality with 30% size using JCC + a trick
Hm I get the blur only if I use JCC that AFAIK uses the PIL libraries. When I save with photoshop the color part of the image, I get a perfect image, at least for my eyes (I'm not an artist though).
Re: PNG quality with 30% size using JCC + a trick
And AFAIK PIL uses libjpeg, the reference implementation for the file format. If you want to compare encoding efficiency, you'd need to compare quality at the same file size, preferably with the same subsampling settings.
-
- Veteran
- Posts: 230
- Joined: Sat Jul 03, 2010 7:22 pm
- Completed: Touhou Mecha Chap. 1
- Projects: Touhou Mecha, Eastern Starlight Romance
- Organization: Dai-Sukima Dan
- Contact:
Re: PNG quality with 30% size using JCC + a trick
So I decided to try out max quality JPEG over what the jcc.py gives me, after reading this. But I have two problems with PhotoShop's batch process:
1. Renaming files doesn't seem very flexible (couldn't tack .base.jpg on the end of every file)
2. If you tell it to "include all subfolders" in the conversion, it doesn't maintain the folder structure for the converted files and instead dumps everything in one folder, so I have to sort everything out again.
Do you guys use another program to streamline PNG to JPG conversion, or am I missing something?
1. Renaming files doesn't seem very flexible (couldn't tack .base.jpg on the end of every file)
2. If you tell it to "include all subfolders" in the conversion, it doesn't maintain the folder structure for the converted files and instead dumps everything in one folder, so I have to sort everything out again.
Do you guys use another program to streamline PNG to JPG conversion, or am I missing something?
-
- King of Lolies
- Posts: 4538
- Joined: Mon Nov 26, 2007 9:57 pm
- Completed: R.S.P
- Location: Bandung, West Java, Indonesia
- Contact:
Re: PNG quality with 30% size using JCC + a trick
Do you know where I can get this JCC? I've been searching in all kind of websites and google but never find the correct JCC.
"Double the princesses, quadruple the fun!" - Haken Browning (SRW-OG Endless Frontier)
DeviantArt Account
MoeToMecha Blog (under construction)
Lolicondria Blog (under construction) <- NSFW
DeviantArt Account
MoeToMecha Blog (under construction)
Lolicondria Blog (under construction) <- NSFW
-
- Veteran
- Posts: 230
- Joined: Sat Jul 03, 2010 7:22 pm
- Completed: Touhou Mecha Chap. 1
- Projects: Touhou Mecha, Eastern Starlight Romance
- Organization: Dai-Sukima Dan
- Contact:
Re: PNG quality with 30% size using JCC + a trick
It's in the wiki-based Ren'py cookbook. I assume that means it was made by someone from around here, which is probably why you had trouble finding it.LVUER wrote:Do you know where I can get this JCC? I've been searching in all kind of websites and google but never find the correct JCC.
http://www.renpy.org/wiki/renpy/doc/cookbook/JCC
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: PNG quality with 30% size using JCC + a trick
Xnview is easier and faster, and also can remove metadata.
Re: PNG quality with 30% size using JCC + a trick
XnView is an option, but setting the JCC script's quality to 95-98% should already be close to optimal.Graph wrote:Do you guys use another program to streamline PNG to JPG conversion, or am I missing something?
-
- Veteran
- Posts: 230
- Joined: Sat Jul 03, 2010 7:22 pm
- Completed: Touhou Mecha Chap. 1
- Projects: Touhou Mecha, Eastern Starlight Romance
- Organization: Dai-Sukima Dan
- Contact:
Re: PNG quality with 30% size using JCC + a trick
Ah, I should've thought of changing the script itself. It was easy to find the quality variable since you mentioned what I should be looking for. Thanks!AxemRed wrote:XnView is an option, but setting the JCC script's quality to 95-98% should already be close to optimal.Graph wrote:Do you guys use another program to streamline PNG to JPG conversion, or am I missing something?
- TheGuraGuraMan
- Veteran
- Posts: 365
- Joined: Sat Nov 03, 2012 3:48 pm
- Location: France
- Contact:
Re: PNG quality with 30% size using JCC + a trick
Recently found that : http://tinypng.org/ wonder if it would works...
Re: PNG quality with 30% size using JCC + a trick
It's basically pngquant/pngnq wrapped in a webservice. It decreases the PNG to 256-color mode, with a noticeable quality loss especially for larger images.
Who is online
Users browsing this forum: No registered users