RimWorld

RimWorld

213 ratings
Image Opt
5
4
4
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.6
File Size
Posted
Updated
6.426 MB
7 Aug @ 2:36am
29 Aug @ 8:10pm
26 Change Notes ( view )

Subscribe to download
Image Opt

Description
This is a mod that attempts to optimize texture image loading times.

Refactored on August 23, 2019
Fully multi-threaded the reading, loading, and uploading of data to the GPU, further optimizing performance.
Future support will only be available on 64-bit Windows due to the use of the D3D11 API.

Main features of this mod:
  • For PNG/JPEG images: Multi-threaded parallel reading, decoding, and loading, significantly improving loading speed.
  • For DDS images: Multi-threaded file reading, slightly improving loading speed.
  • For DDS.zstd images generated by this mod: Same as DDS images, but significantly reducing the storage space on the hard drive.
  • Detect expired textures and automatically regenerate them

Q&A
What's the difference between Graphics Settings+?
GS+ only has single-threaded loading of DDS images.

What's the difference between and rimsort's optimize texture?
rimsort can only generate DDS images, not ZSTD compression.

What are the benefits of enabling ZSTD compression for DDS?
Compressed DDS images become smaller, reducing disk space usage (but not reducing video memory usage).
ZSTD decompression is very fast and has little impact on loading speed. (Especially when loading in multiple threads)

What are the benefits of converting existing PNG images to DDS?
DDS is a format that can be directly read by the GPU, making it faster to load, using less video memory, and putting less strain on the GPU rendering.

What is automatic regeneration of expired textures?
Imagine a scenario where you generated a DDS texture yesterday, and today the mod author changes a PNG image (while the image name remains the same). Even though the mod has been updated, you're still using the old DDS texture created yesterday.

This feature in this mod checks the modification date of the image file when loading. If the DDS file is older than the source PNG file, it automatically regenerates a new DDS file.

This operation is time-consuming, but considering that texture updates are rare and loading is multi-threaded, the cost should be acceptable.

Error: Error creating texture, code: <int>
Please first try using this mod's texture compression tool (found in the mod settings) to regenerate all DDS files. If the error persists, please include the log file when reporting the error.

error: Texture2D.***: not allowed on native textures.
Please see the compatibility section. Report this mod (or provide logs) and I'll add it to the compatibility list for additional processing.

Recommended Usage
After enabling this mod, open the game and go to the mod settings page. Click to open the GPU Compressed Texture Tool, check all options (including Overwrite and ZSTD), set the quality to High, and then click the Generate button. Wait for the multi-threaded compression to complete; do not close the window. For reference, processing the 23,600 images in the 550 mod took approximately 600 seconds on my 5600 CPU.

If you previously generated DDS files using rimsort/rimpy, you can first click Clear All DDS Files to reduce disk usage.

This operation will not delete or modify any of the mod's PNG images; it will only generate/delete the DDS files and will not damage the mod content.

When using this mod, if you:
1. Do not use .dds files: You will benefit from the loading speed improvements provided by parallel decoding.
2. Using DDS files generated by this mod or rimsort: There is no difference from using Graphics Settings+ alone. DDS files themselves load very quickly, but parallel loading provides a slight increase in loading speed.
3. Using the dds.zstd files generated by this mod: The disk space occupied by the DDS files is significantly reduced.

Compatibility
Theoretically, this mod is incompatible with any mod that modifies texture loading code, with the exception of Graphics Settings+.
This mod can be used with Graphics Settings+. The DDS loading function and mipmap bias in Graphics Settings will not be applied, but texture memory usage calculations will function normally.

The texture2D created by this mod cannot be read/written by the CPU, causing errors in mods using methods like GetPixel(s), ReadPixels, SetPixels, and EncodeToJPG. The current workaround is to manually patch the GetPixels32 implementation, but I'm not sure if there are other mods that use other unsupported methods.

This mod will disable the vanilla 'Image Compression' option, because this option essentially compresses the image on the fly when loading. It works the same way as using DDS, but the image quality is worse and the loading time is longer. If you need this feature, then I don't think you need ImageOpt (

Differences from vanilla:
As of 1.6.4.4552 unstable, vanilla has built-in functionality for reading DDS files. This is similar to what Graphics Settings+ does, but it still doesn't seem to offer the ability to modify mip bias (which both Graphics Settings+ and this mod do).

AI-generated content:
* English translation
* Logo image

tips: .zstd is a compression format. If your compression software supports it (such as bandizip), you can even open it directly and see the .dds file inside.
172 Comments
What happens after I remove the mod? I don't expect it to delete the files, but does everything goes back to normal? Can I just re-add it and not need to re-compress it again? :automatons:
Pupil_passed 26 Oct @ 1:31pm 
这个mod会使原版的`画质压缩`选项失效,因为这个选项本质上是在加载时即时压缩图片。它的原理和功能跟使用dds是一样的,但是画质更差并且会延长加载时间。如果你需要用这个功能,那我想你不需要ImageOpt(
实际使用下来并不是简单的即时压缩,可能涉及到内存利用的方面,我在开启你这个模组后内存就爆掉,打不开游戏了
Thetaprime 16 Oct @ 9:17am 
Also, does this compress the files in the Mods folder of the game install?
Thetaprime 16 Oct @ 9:16am 
I have a question. Normally I use ToDDS to compress textures to DDS and there are about 33,000 files. This is only compressing about 22,000. Any ideas why there is such a large difference?
伊崎苍空 15 Oct @ 11:27pm 
我在用转了zstd之后打不开游戏了,那我该怎么把zstd全部删掉?
frus-m 5 Oct @ 5:57am 
Докладываю: мод не работает с высоким разрешением 3840х2160. играю на двух компьютерах в разных местах - точная копия с переносом папок. На втором Full HD и на нем работает прекрасно. Если удаляю мод на первом - игра загружается.
覆盖全球 19 Sep @ 9:16pm 
1.5有吗 大佬
MerLatus 19 Sep @ 5:14pm 
不知道为什么,第一次用还是好的,过了两天后突然爆大量黄字说找不到dds文件,找不到id。dds全部清除重新加载好了,过几天又爆黄字找不到dds和id
370694379 15 Sep @ 5:56am 
真的牛逼8分钟变成3分钟
吱吱宸 14 Sep @ 8:22am 
@zonde306 用rimsort转换就行了