haganbmj / MagicSetEditor2

Magic Set Editor is a program for designing trading cards
Other
17 stars 7 forks source link

bit depth loss from 32 to 24 #64

Open Armagedon13 opened 9 months ago

Armagedon13 commented 9 months ago

i have a template : card width: 813 card height: 1185 card dpi: 350 32 bit depth (i have the images to that resolution) when exporting a card maintain the aspect ratio but not the bit depth

haganbmj commented 8 months ago

Yeesh, I know MSE does some funky stuff when storing the card images. It crops and resizes them into the set bundle and probably throws away any of the original information... or at least doesn't use it during export.

I had originally forked to try and address some of the sizing limitations MSE had (see https://github.com/haganbmj/MagicSetEditor2/pull/3), but it sounds like there are more things to improve.

Armagedon13 commented 8 months ago

well, i only put this issue because the resolution loss is to much, i can't test the code by myself because i can't build it.

Armagedon13 commented 8 months ago

maybe this? https://github.com/haganbmj/MagicSetEditor2/blob/f97a82a837581ab48ebb9119d00c0a3e82f45fdb/src/gfx/resample_text.cpp#L33

haganbmj commented 7 months ago

That looks to be related to how it draws text, I'm thinking it's this line as this is the primary rendering function for the output image if I recall correctly - it doesn't look to take the template or user-supplied images into account.

https://github.com/haganbmj/MagicSetEditor2/blob/1f247a855f69e23b301f7799e45c7f2601d81484/src/render/value/image.cpp#L104

Armagedon13 commented 7 months ago

that's because i send the wrong one, now why make the bit depth to 24? i was thinking that read from the image or the project, maybe add the bit depth in the script of the project idk.

Armagedon13 commented 7 months ago

https://www.computerhope.com/issues/ch001557.htm

haganbmj commented 7 months ago

I'm less sure that's the only place that matters now that I read more into it, it seems that wxWidgets uses a default depth based on the screen.

https://docs.wxwidgets.org/3.0/classwx_bitmap.html#a3bb19e8d368d6565f52a9c1294d80d7a

Armagedon13 commented 7 months ago

OK, it indicates the number of pixels your screen contains, which generally today all handle 32-bit colors.