Posted: Thu Jun 19, 2014 11:15 am Post subject:
Canvas optimizer
Subject description: also batch conversion capable
Since too big canvases need unnecessary amount of RAM during rendering ingame, it would be nice to have a tool that optimizes the canvas.
When using the tool, it should shrink the canvas to the smallest possible size, while every colored pixel on all frames are still kept visible.
During this it should of course keep the object centered.
e.g. shadows tend to go to the right side, while the left is empty. In this case the left can't be made smaller than the right or the object would be misaligned ingame.
It would be also nice if there is an option, to reduce the canvas size only to multiple of 48 (or 60 for RA2) as usual canvas sizes are
48x48
96x96
144x144 etc and combinations like 48x96
And then of course a batch conversion to do this on multiple files at once would be nice. _________________ SHP Artist of Twisted Insurrection: Nod buildings
It would be handy for sure but I am not sure on the memory allocation as basicly the game loads them into memory as files directly and then draws from them accordingly and it does use actual canvas limitation in actual stored frame to draw while I presumed basic logic that it uses the full dimension always but what point would there be to draw the blank area (outside of canvas cut stored frame), surely Westwood wasn't that dumb?
What I asked around, most seem to think its merely drawing the internal frame and does not allocate any more memory than what the SHP loaded took as file.
Actual multiples in size is not necessarily relevant (just tidy convention) as stored frame is always canvas cutted to weird dimensions of non multiples if you look up shp headers.
Admittedly I also preach doing this trimming while I am not sure it makes difference or not, actual filesizes are not affected given SHP has its internal canvas cut compression for the excess blank while internal canvas frame background blank is then handled by RLE (C3)
Plus I suggested to Banshee ages ago to do a frame trimmer tool but still nothing...
If shp has 50 frames and you want it halfed, it would delete every 2nd frame to smoothen potentially too slow animation. QUICK_EDIT
i heard from AlexB, Hyper (or another exe pro, don't know anymore), that the game renders/handles SHPs ingame as if they are BMPs, which means they need the space to store the complete canvas and not only for the visible part.
And thus the canvas optimization should help reducing needed RAM and maybe improve performance when lots of SHPs are rendered at the same time. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Well, I would frankly like if someone of the 'exe pros' would finally conclusively put the issue at rest as any inside views so far from them are surfaceful...
Until then we're left assuming if its optimal or it isn't and doing things based on guess, maybe performance difference is minimal by today standards but nonetheless...
I've asked the same pros over the years and frankly it hasn't gone further than comment that it doesn't use more memory than what the RAM loaded shp as file took to draw it. QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Thu Jun 19, 2014 9:29 pm Post subject:
Quote:
it would be nice to have a tool that optimizes the canvas.
When you save an SHP file with OS SHP Builder or even other programs like XCC Mixer, the program does optimize the canvas before storing its pixels in the file. I think it did that since version 1.0 of BS SHP Builder. QUICK_EDIT
What LKO means is that there should be a function to automatically make the canvas smaller when there's a lot of free space around the object in the center. _________________ QUICK_EDIT
imagine a 800x600 pixel big SHP with only a tiny 1x1 building in the center. On such an SHP you could reduce the canvas from 800x600 down to only 48x48.
In the past i've seen quite a lot of SHPer to release SHPs right how they came out of their renderer. And usually they render the images in 320x240, 640x480 etc, the default settings in 3dsmax or other 3d programs. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Thu Jun 19, 2014 11:11 pm Post subject:
I do understand what you mean, but I don't necessarily agree with it.
I know that it would be useful to automatically resize down the canvas size to whatever is useful in a image generated by a renderer. The problem is the automatic part of it. I can't simply suppose that any image that is imported by the program comes from a render, nor that the user shall not paint the currently unpainted pixels around it.
The frame trimmer tool seems to be viable. I just couldn't be bothered to code it yet and OS SHP Builder is not my priority at the moment, due to the bad situation of my thesis proposal. QUICK_EDIT
No, not automatically always.
What i mean is a new option in the menu: "optimize canvas" which then makes the canvas as small as possible.
And another option "batch conversion" inside the "optimize canvas" menu, which allows to do this on multiple files.
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Fri Jun 20, 2014 2:32 pm Post subject:
Yea, it could come handy like how the Crop section works in VXLSE. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum