sn4k3 / UVtools

MSLA/DLP, file analysis, calibration, repair, conversion and manipulation
GNU Affero General Public License v3.0
1.15k stars 103 forks source link

[FEATURE REQUEST] 8 bit grey scale image for dl2p format #899

Closed Veenxz closed 2 weeks ago

Veenxz commented 2 weeks ago

Is your feature request related to a problem?

Hi,

I am working on 4D printing for hydrogels, now I can only get 16 grey values using UV Tool. Would it be possbile for me define more light intensity on my pattern?

Thanks for the wounderful tool!

Describe the solution you'd like

Files

UVtools.Core/FileFormats/PhotonWorkshopFile.cs

    public sealed class LayerImageColorTable
    {
        [FieldOrder(0)] public uint UseFullGreyscale { get; set; }
        [FieldOrder(1)] public uint GreyMaxCount { get; set; } = 16;
        [FieldOrder(2)] [FieldCount(nameof(GreyMaxCount))] public byte[] Grey { get; set; } = {
            // AA16: 255, 239, 223, 207, 191, 175, 159, 143, 127, 111, 95, 79, 63, 47, 31, 15
            15, 31, 47,    // 1,2,3
            63, 79, 95,    // 4,5,6
            111, 127, 143, // 7,8,9
            159, 175, 191, // 10,11,12
            207, 223, 239, // 13,14,15
            byte.MaxValue  // 16
        };

        [FieldOrder(3)] public uint Unknown { get; set; }

        public override string ToString()
        {
            return $"{nameof(UseFullGreyscale)}: {UseFullGreyscale}, {nameof(GreyMaxCount)}: {GreyMaxCount}, {nameof(Grey)}: {Grey}, {nameof(Unknown)}: {Unknown}";
        }
    }
github-actions[bot] commented 2 weeks ago

This is your first time submitting an issue with UVtools 🥳Please review your issue and ensure that the submit template was followed, the information is complete, and not related to any other open issue. It will be reviewed shortly. Debugging is very important and make the program better. Thanks for contributing and making the software better! 🙌

sn4k3 commented 2 weeks ago

Anycubic uses fake AA each level is time fractions of exposure time and not real grey values. (LCD always lit full white pixel but with less time for AA) If you want to use more than 16 values you can set set higher AA level and the table will adjust accordingly by the slicer. I don't know if firmware will accept anything more than 16x, you would need to test it.

If you require real grey shift away from anycubic machines or adapt mSLA klipper firmware to get full control over it.

Veenxz commented 2 weeks ago

I'm using the Anycubic D2 DLP printer, I have tested the machine and could adjust the exposure intensity according to the grey scale. The max brightness in UVTools is 255, I didn't find how to set a higher AA level in the software. BTW, could I adjust the exposure time and greyscale in one slice?

If I import this file in UVTools, the saved file will only get 16 greyscales. Intensity_test.zip

The dl2p file: 0-100-delta2_light_1.zip

You can also see, in the test, that some patterns have converged to the same greyscale.

Grey_test layer36

sn4k3 commented 2 weeks ago

The dl2p file: 0-100-delta2_light_1.zip You can also see, in the test, that some patterns have converged to the same greyscale.

That file uses AA=1 defined on file, if it does gray values firmware may ignore all information on it and convert grays directly.

The max brightness in UVTools is 255

Thats the max pixel color of every lcd, color or mono max is 255 per pixel. You can't use higher values.

I didn't find how to set a higher AA level in the software.

Every slicer uses a max of 16x. Anycubic sets a table of 16x no matter the AA level.

Veenxz commented 2 weeks ago

Got it. Thanks for your reply!