Jump to content

null54

Moderator
  • Posts

    1,964
  • Joined

  • Last visited

  • Days Won

    90

Posts posted by null54

  1. 41 minutes ago, Rick Brewster said:

    Any code in that area that recently changed?

     

    In version 1.12.0 there were a few changes:

    • The image I/O code was rewritten use DirectXTex's native image type when loading and saving, this is the image parameter in the managed stack trace.
    • I also changed the P/Invokes from DLLImport to LibraryImport.

    Without the native callstack I have no idea where the problem is.

     

    I don't have any native arm64 devices that can run Windows. It may be possible to install the arm64 version of Windows 11 in an emulator on my x64 machine, but I am not sure about that.

  2. 54 minutes ago, Reptillian said:

    However, with the image, I seem to be getting 237 colors, and with modifying XML, there's 253 colors?

     

    The XML contains 238 unique colors, in both RGB and YCrCb formats. Based on UseForm attribute in the XML it appears that the device uses the YCrCb values when it displays the image.

    I have no clue what the T value is in the XML, but several entries are the same except for that field.

    The last palette entry is all zeros, so I am guessing that it is invalid/unused.

  3. Release version 1.12.1.

    Changes:

    • Improved support for loading the 'swizzled' BC3/DXT5 normal map variants used by DOOM 3 (and possibly other games using the same engine).
    • Added support for loading FlatOut 2 textures with an incorrect DDS_PIXELFORMAT size.
    • Like 2
    • Hugs 1
  4. 1 hour ago, Rick Brewster said:

    Does this happen with all of the DDS images in Fallout 2? (wait, doesn't FO2 predate DDS?)

     

    The game is FlatOut 2, some kind of demolition derby racing game. I downloaded a few mods for the game from moddb to investigate this issue, and many of the modded DDS images have the DDS_PIXELFORMAT issue I mentioned above.

    Fallout 2 uses its own custom image formats, not dds.

     

    1 hour ago, Rick Brewster said:

    how feasible/reasonable would it be to support these incorrectly formatted files?

     

    It would be simple to patch the header size issue, it is just one line of code to modify.

    It turns out I was wrong about the mipmap issue. I had forgotten that the DDS format includes the main image in the mipmap field count, so 11 mipmaps in a 1024x1024 pixel file is the expected number.

  5. 24 minutes ago, Comilarex said:

    I want to combine a flat colour image (png) with an alpha image (png, greyscale) into .dds.

     

    It should be possible with @BoltBait's Apply Alpha Mask plugin using the following steps.

    Note that the color and alpha mask images must be the same size.

    1. Load the color image.
    2. Add the alpha image as a new layer using Layers > Import From File.
    3. Run the plugin (Object > Apply Mask) on the color layer, select alpha layer, set the mask type to Alpha and ensure the Method option is set to Replace.
    4. Delete the alpha layer.

    This should give you a color image with the alpha channel set from the mask image.

  6. Release version 1.12.0.

    Changes:

    • Reduced memory usage when loading.
    • Various optimizations to the loading and saving code.
    • Only enable the Error Metric option for BC1-BC3.
    • Added the plugin version to the save UI.
    • Show an error when loading a texture array or volume map.
      • These files posed a silent data loss risk when saving because the plugin does not read all of the images.
    • Like 2
    • Upvote 1
  7. 35 minutes ago, xiaoqu said:

    I mean, all the AVIF encoders I have come into contact with before this were controlled by two quantizer values (a minimum and maximum), both of which ranged from 0 to 63. But the AVIF encoder on paint.net is only controlled by a quality factor of 0 to 100.

     

    The plugin encodes images using AOM's constant quality mode with the minimum and maximum quantizers set the the same value.

  8. 10 minutes ago, xiaoqu said:

    Also, does the avif on paint.net have any stipulations about the maximum and minimum quantization range?

     

    I am unsure what you are referring to by stipulations.

    The plugin uses the full av1 range of [0, 63], but the exact av1 quantizer value is undefined for any quality value between 0 and 100.

  9. 31 minutes ago, xiaoqu said:

    Can you tell me the correspondence between the quality factors 0 to 100 in avif and the quantizers [0,0] to [63,63] in av1?

     

    A quality value of 100 corresponds with an av1 quantizer value of 0, and a quality value of 0 corresponds with an av1 quantizer value of 63.

    The other quality values are mapped to the av1 range using a simple algorithm: https://github.com/0xC0000054/pdn-avif/blob/2b17f7b9ff45f5ae98959f98904166cfa62c288d/src/AvifNative/AV1Encoder.cpp#L122

    • Thanks 1
  10. 12 minutes ago, moshemoshe said:

    So I guess the next question is how i'd go about uncompressing the 2.66MB back into 15.996MiB size.

     

    The 15.996 MiB value is probably the uncompressed size of the texture in memory, 2048 * 2048 * 4 RGBA channels.

    DXT1 compression stores the image color data as RGB 565 (5 bits for red and blue, and 6 bits for green), with an optional 1-bit alpha channel.

    When the image is loaded, it is decompressed with the RGB and alpha data getting expanded back to 8-bits-per-channel.

     

    Paint.NET shows a 2048x2048 pixel image as require 16 MiB of RAM.

    • Like 1
  11. 28 minutes ago, moshemoshe said:

    because the game has uncompressed DXT1 texture at 15.996MiB, but the same texture becomes 2.0MB after editing it.

     

    DXT1 is a compressed format, there is no such thing as uncompressed DXT1.

    I am guessing that the size difference may be due to the original file having mip maps, try enabling the Generate Mip Maps check box.

    If that does not work, upload one of the original DDS files somewhere and post a link to it here.

     

    What are the dimensions of the image you are working with? 15 MB seems large for a DXT1 compressed file, even with mip maps.

×
×
  • Create New...