Jump to content

On portrait sizes


Recommended Posts

Posted (edited)

This is all known information, but I'm not sure if it's actually summarized anywhere.

There are now seven different portrait sizes used across the BG/IWD games. In the notes below I'll use the term 'S' or 'L' portrait; this is the suffix used with the portrait by the internal naming convention (e.g. IMOENS.bmp or IMOENL.bmp).

  • 36x58
    • An Icewind Dale exclusive, used for the game screen as the S portrait.
    • This portrait is also unique in that it's the only portrait that is cropped to just the face of the character; all other portraits across the games are generally the same portrait resized and not cropped at all.
  • 38x60
    • Used in the original BG and BG2 as the game screen portrait as the S
    • In original BG2, this S image also appears in the dialogue window.
  • 42x42
    • An IWD2 exclusive S portrait, used only for the game screen.
  • 54x84
    • Defined in the EEs as the S portrait, but appears to be unused.
  • 110x170
    • Used in original BG/IWD as the record screen portrait as the L portrait
    • This size is also used by the original BG2 as the record screen, but is instead designated M.
  • 169x266
    • Size exclusively used by the EE as the game screen and dialogue window portrait, designated M
  • 210x330
    • In IWD and BG this G portrait is used for the initial portrait selection image during character creation. However, once selected the rest of character creation process uses the smaller L portrait
    • In original BG2 this is the L portrait and used only as the epilogue portrait
    • As the L portrait, used in IWD2 for everything but the game screen
    • For the EEs this the L portrait and used for the epilogue and record screens

Creature files designate a small and large portrait at offsets 0x34 and 0x3c, respectively. By convention above these are respectively the M/L portraits (BG2, EEs) or the S/L (BG, IWD, IWD2).

Edited by CamDawg
updated for BG G portrait
Posted (edited)

Or put another way:

  • Original IWD uses a cropped 36x58 S portrait for the game screen, a 110x170 L portrait for the record screen, and has a 210x330 G portrait that is used only for portrait selection during character creation.
  • Original IWD2 uses a cropped 42x42 S portrait for the game screen, and a 210x330 L portrait for everything else. Unlike the other games, there is no third portrait.
  • Original BG uses a 38x60 S portrait for the game screen, a 110x170 L portrait for the record screen, and has a 210x330 G portrait that is used only for portrait selection during character creation.
  • Original BG2 uses a 38x60 S portrait for the game screen and dialogue window, a 110x170 M portrait for the record screen, and a 210x330 L portrait for the epilogues in ToB.
  • The EEs uses a 169x266 M portrait for the game screen and dialogue window, and 210x330 L portrait for the record screen and epilogues in ToB. They also include a 54x84 S portrait that appears to be unused.

It's possible the EE S portraits are used somewhere obscure (character arbitration?) but I've yet to find it; same deal for the BG G portraits.

To make portraits available to the player, EEs only need the L version dropped into the portraits folder in the documents folder. The others either need the M and L portraits (BG2) or the S and L portraits (BG/IWD/IWD2) dropped into the game directory's portraits folder. The custom portrait screen for IWD uses the L portrait, and hence G is not needed for PC-available portraits.

Edited by CamDawg
updated for BG G portrait
Posted

AFAIK the EE engine will scale portrait files to whatever size it needs.

I'm positive that it downscales though I haven't tested upscaling (why would anyone wanna do that?) and I'm also not sure how tolerant it is in regards to aspect ratio.

For pure size though, even rather large portraits like 420x660 or something should work just fine.

 

Posted

Aye, there is no need to ever use one greater than 210x330 since that's the biggest any of the games uses. There is, however, also no need to manually down-scale a bigger portrait since the engine can handle that itself.

That's definitely something that should be noted for the IESDP.

Posted

Actually, now that I think about it, I'm not sure the EE games' epilogue portraits are really displayed at 210x330 and not upscaled by default? If the game did upscale them by default, that would mean that a size bigger than 210x330 would theoretically offer a slightly better quality.

No idea about that though. Maybe it's something CamDawg knows about..

Posted
On 1/9/2019 at 7:20 AM, lynx said:

the big ones are used also in bgs for character generation, not just iwd.

They are indeed--updated.

Posted
On 12/28/2018 at 4:59 PM, CamDawg said:

It's possible the EE S portraits are used somewhere obscure

I believe they're used by non-joinable NPCs for dialogues. In original BG2, Bodhi, Ellesime, Irenicus, the Five, Gromnir, and Melissan all have 38x60 portraits but nothing larger. In EE, most of those are replaced by 54x84 portraits. (For some reason, Abazigal, Balthazar and Gromnir don't get new versions; they're noticeably blurry in-game.)

Posted

I was working on downsizing/cropping some original artwork from 1024x1024px to the EE portrait sizes, and decided to do a little testing.  I tested with BG2EE v2.6.6.0.  My results seem to be contrary to conventional wisdom.  Using ImageMagick I resized and cropped a test portrait to the three EE sizes:  210x330 Large, 169x266 Medium, and 54x84 Small.  On a hunch I also made one that was 420x660 (I’ll call it G for Giant) and tried all of them in-game.  On the Records screen (which conventional wisdom says should use the Large size), the Giant portrait was noticeably the clearest, the Large was a bit blurry, and the blurriness got worse with decreasing size.  When I took a screenshot and counted the pixels of the portrait on the Records screen, I got 253x392px (I’ll call it H for Huge).

The portrait overlapped the border by at least 1 column of pixels on the right, and a row of black/dark pixels between the portrait and the bottom of the frame around it, and 1-2 rows of black/dark pixels between the top of the portrait and the frame.  I believed this was an indication the engine was maintaining aspect ratio when resizing the portraits.  To be sure, I tried the original 1024x1024 portrait, but the same 253x392px with the same border was displayed on the records screen (with the aspect ratio clearly distorted).

I then used ImageMagick to resize the original to 253x392px and tried it in the game.  I compared the in-game screenshots for the Giant, Huge, and Large portrait sizes to each other and to the Huge size outside the game.  The Huge was less blurry than the Large, but perhaps ever so slightly more blurry than the Giant (with a caveat).  The Huge portrait displayed in the Records screen at a slightly different aspect ratio than did the Giant and Large.  Comparing in-game and out-of-game Huge portraits, I could perceive no visual difference between the two.  This indicates the game is distorting the aspect ratio of the Giant and Large portrait sizes.  For the caveat:  the difference in perceived blurriness was so minor I was probably just seeing artifacts caused by the different area ratios.

All of this was tested with the “Scale User Interface” in-game option turned ON.  When I turned it OFF and counted the pixels of the portrait on the records screen, I got 180x279 which is the same aspect ratio as the Huge listed above (actually the same area ratio would be 180x278.8932806 but it rounds to the nearest whole pixel).  I maintain this is evidence all of my observations so far remain true with this setting turned off, it’s just that everything appears smaller on screen and so the differences would be harder to spot.

 

Moving on to the portraits on the game screen, I again tested with “Scale User Interface” in-game option turned ON.  I tested all three (Large, Medium, and Small) of the traditional EE portrait sizes as well as the Giant and Huge sizes specified above.  On the game screen (which conventional wisdom says should use the Medium size), the Giant by far looks the worst, Huge is pretty bad too, and the Small is very blurry.  Large and Medium are pretty close in my test case, but Medium is just a bit better.  When I took a screenshot and counted the pixels of the portrait on the game screen, I got 76x118px.  For comparison, Medium is 169x266px which means it is being downscaled significantly even when up-scaling the user interface.  Comparing the Medium portrait to a 76x118px one sized/cropped with ImageMagick, the results are quite similar.   Personally, I prefer the ImageMagick result in terms of detail vs blurriness.  I also think ImageMagick’s 76x118px result is more accurate in terms of aspect ratio, but the difference is probably on the order of half a pixel.  Note that the 76x118px game screen portrait has the same aspect ratio (within rounding) to the Huge one calculated from the Records screen screenshots above.

 

I suspect that DPI scaling settings and monitor dimensions may play a role in this, for the sake of transparency I am testing on a modest 1920x1080 laptop screen with 125% DPI scaling with OpenGL version 4.4.0 – Build 21.20.16.4550 running on Intel ® HD Graphics 530.

 

My takeaways:

·        BG2EE’s internal scaling algorithm:

o   Does not maintain aspect ratio

o   Is better at downscaling than upscaling, but only up to a certain point.  Large factor downscaling produces inferior results to what can be achieved by 3rd party tools.

·        On my setup, ideal dimensions for the “Large” portrait size are 253x392px and NOT the conventionally accepted dimension of 210x330px.

·        On my setup, ideal dimensions for the “Medium” portrait size are 76x118px, but the conventional 169x266px size produces similar results depending on the scaling algorithm.

·        Using only a single (Large) portrait in both the “Large” and “Small” slots found within a PC/NPC’s CRE structure results in inferior results for the smaller portrait (depending on quality of the internal/external scaling algorithm).  The unmodded EEs only allow to select a single portrait during character generation that is assigned to both slots.

I would appreciate if anyone else testing under a different environment could confirm/deny my findings.  @Bubb, I recognize this is not likely your area of interest, but if you have any particular knowledge about what the engine is actually doing here that would be very informative.

Posted (edited)

Please delete this post.

Edited by skellytz
The post initially wasn't registered by the forum cache and couldn't be viewed when logged out. Reposted.
Posted

First, let's set a baseline on BG2:EE without GUI scaling:

Party sidebar/dialogue window: 54x84

54x84.png.d01d5ef1e751ee220bfee55ba5c90432.png

Character record: 180x279

180x279.png.683c35fb102ec8362bb2db664cc735d0.png

Of course, if you size your portraits exactly like this, they won't look as good when you turn GUI scaling on. To compensate for GUI scaling, Beamdog went for images sized by default 169x266 (party sidebar/dialogue window portrait, suffix: M) and 210x330 (character record, suffix: L) for most vanilla CREs. Yes, the aspect ratio will be slightly off when the engine scales the images to fit the frames. At the same time, we can't assume everybody's playing with GUI scaling on, so it's harder to recommend an optimal size.

Same results as Sam.'s at 1080p with GUI scaling on:

Party sidebar/dialogue window: 76x118

76x118.png.45b6567f29e66e9836800b4c54cff9e0.png

Character record: 253x392

253x392.png.1149d30f95f041a7a8153f5ba432568d.png

Moreover, some portrait artists prefer to zoom in on the character's face for the party sidebar/dialogue window portrait rather than using the same image. From my observations, when using the custom portraits feature through the GUI to make a set of large and small portraits, the process is a bit messed up:

  • The character record portrait suffix L must be capitalized and the filename can't be longer than seven characters (including the suffix), e.g. "abcdefL.bmp"
  • The party sidebar/dialogue window portrait suffix M must be capitalized; the filename must match the L portrait and can't be longer than seven characters (including the suffix), e.g. "abcdefM.bmp"

Now the engine automatically assigns the L variant to the character's CRE field "large portrait" (offset 0x3c) and the M variant to the "small portrait" (offset 0x34).

The engine won't recognize the images as a set and either won't properly display the smaller variant or split/duplicate the images on portrait selection if:

  • there is a filename mismatch between the L and M variants.
  • the filenames are maximum eight characters long instead of seven.
  • the suffixes are different letters than a pair of L and M.
  • the suffixes are lowercased.
Posted

Sorry for offtop but maybe someone can help me, my question is about portraits size for Temple of Elemental Evil. The main image is 130x150 and should be cropped to 53x47 and 42x37 for small and mini variants respectively. They also should have black border so their real resolutions are 51x45 and 40x35 but it's not a question. How do I crop main image to these resolutions through Photoshop if they aren't enough even for the face? It's obvious that only the section of main image should be resized but how do I find its accurate resolution first?

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...