I'm making some new backgrounds for myself but I can seem to work out how to get a better resolution. Using BGS as an example, for most of it's backgrounds it uses an image size of 1024x513. This is quite small on my 1600x900 display. Oolite zooms this image, which results in a bit of fuzziness. But if I create a background at 1600x900, Oolite still zooms it.
Is there a special size I should be using? I've tried various sizes but they all get zoomed.
Background image sizes
Moderators: winston, another_commander
Re: Background image sizes
The "main area" - the bit the default HUD and GUI screens fits in - has a size of 512x512 units. Images will be scaled so that the central 512x512 pixels of the image correspond to those units. This is necessary to ensure that one single background image works on any size of display window.
The problem, of course, is that on modern screens especially, 512 pixels is not a lot.
Increasing the size of the "main area" - say to 1024x1024 units - would of course mean that all existing backgrounds ended up half-size. I've been thinking on and off about solutions for this for quite a while now, without really getting anywhere, so suggestions for backward-compatible approaches to the problem are welcome.
The problem, of course, is that on modern screens especially, 512 pixels is not a lot.
Increasing the size of the "main area" - say to 1024x1024 units - would of course mean that all existing backgrounds ended up half-size. I've been thinking on and off about solutions for this for quite a while now, without really getting anywhere, so suggestions for backward-compatible approaches to the problem are welcome.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Background image sizes
I vote for the 1024x1024 main area and I think there are 2 different solutions:
1. If the height of a background is less than a number (768?) then assume old picture and resize it, otherwise display without changes.
2. Define new keys in plist like equip_ship_hires for the new images which displayed as is and resize others in old keys if no large variant given.
No worry about large pixels produced by resize, it is easy to make proper large pictures using a converter with lanczos filter which make good work during enlarging, similar with antialiasing, so a new set of BGS pictures can be done instantly.
1. If the height of a background is less than a number (768?) then assume old picture and resize it, otherwise display without changes.
2. Define new keys in plist like equip_ship_hires for the new images which displayed as is and resize others in old keys if no large variant given.
No worry about large pixels produced by resize, it is easy to make proper large pictures using a converter with lanczos filter which make good work during enlarging, similar with antialiasing, so a new set of BGS pictures can be done instantly.
Re: Background image sizes
I'd rather not go for a solution which involves having two possible sizes of static main area, since monitors with 2048 height are already on sale. Support for more than two options in future without having to change the specification again I think is necessary.Norby wrote:I vote for the 1024x1024 main area and I think there are 2 different solutions:
1. If the height of a background is less than a number (768?) then assume old picture and resize it, otherwise display without changes.
2. Define new keys in plist like equip_ship_hires for the new images which displayed as is and resize others in old keys if no large variant given.
Re: Background image sizes
What about using the same way images is shown in HUDs?
Even though format says 640x480, when adding hires, it automatically scales, even with widescreens, using Y res as base.
Even though format says 640x480, when adding hires, it automatically scales, even with widescreens, using Y res as base.
"There is a single light of science, and to brighten it anywhere is to brighten it everywhere." - Isaac Asimov
Re: Background image sizes
Pseudo-code:cim wrote:The "main area" - the bit the default HUD and GUI screens fits in - has a size of 512x512 units. Images will be scaled so that the central 512x512 pixels of the image correspond to those units. This is necessary to ensure that one single background image works on any size of display window.
The problem, of course, is that on modern screens especially, 512 pixels is not a lot.
Increasing the size of the "main area" - say to 1024x1024 units - would of course mean that all existing backgrounds ended up half-size. I've been thinking on and off about solutions for this for quite a while now, without really getting anywhere, so suggestions for backward-compatible approaches to the problem are welcome.
Code: Select all
var picWidth = getWidth(pic); // we get the size of the pic
var picHeight = getHeight(pic);
var guiWidth = getOption(guiWidth); // we get the size of the gui, as wanted by the player in its game options
var guiHeight = getOption(guiHeight);
var factor = min(guiWidth / picWidth, guiHeight / picHeight); // we use min so the whole pic is used, even if the ratio width/height isn't the one of the screen
var newPic = resize(pic, factor) // pic * factor
It's backwards-compatible, lets the player choose his gui resolution so small configurations have no problem, and the pics may be resized when loaded, and when the player modifies its guiSize game options.
- Norby
- ---- E L I T E ----
- Posts: 2577
- Joined: Mon May 20, 2013 9:53 pm
- Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
- Contact:
Re: Background image sizes
I found a perfect solution here. In short:
Make an image using FullHD resolution (1920x1080) at least. Maybe better to use UHD (3840x2160) when a 28" UHD monitor is $400 in the local store.
Then follow this example in screenbackgrounds.plist:Another example in js (where must use comma and not semicolon):
Do not give the height of the picture! Always use 480 and in this case the game will resize the image to match to the height of the current resolution, leaving out the sides if the display is narrower than widescreen (16:9). I tested successfully with a hd image in my 2048x1152 display. In windowed mode always filled the height regardless of I resized the window.
As Tichy said there is almost nothing improvement if somebody remake the current background images in BGS due to the antialias-like resize routine do nice job in realtime when enlarge a small image. I tried to enlarge one with Lanczos filter which is the best imho and the result was only a bit sharper. But If somebody make new UHD images or mission screens then this solution is well usable for any image and display resolution.
Make an image using FullHD resolution (1920x1080) at least. Maybe better to use UHD (3840x2160) when a 28" UHD monitor is $400 in the local store.
Then follow this example in screenbackgrounds.plist:
Code: Select all
equip_ship = { name: "hdpic.png"; height: 480; };
Code: Select all
setScreenBackground({ name: "hdpic.png", height: 480 });
As Tichy said there is almost nothing improvement if somebody remake the current background images in BGS due to the antialias-like resize routine do nice job in realtime when enlarge a small image. I tried to enlarge one with Lanczos filter which is the best imho and the result was only a bit sharper. But If somebody make new UHD images or mission screens then this solution is well usable for any image and display resolution.
Let's see!phkb wrote:I'm making some new backgrounds
Re: Background image sizes
Good idea. I didn't think of javascript/browsers auto-resize.