{"id":42597989,"url":"https://github.com/futurelink/msla-imaging","last_synced_at":"2026-01-29T00:13:06.991Z","repository":{"id":243801463,"uuid":"810740008","full_name":"futurelink/msla-imaging","owner":"futurelink","description":"mSLA 3D-printer files manipulation library written in Java","archived":false,"fork":false,"pushed_at":"2024-07-06T09:50:46.000Z","size":29261,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-06T17:52:41.429Z","etag":null,"topics":["3d","3d-printing","msla","pcb"],"latest_commit_sha":null,"homepage":"http://msla.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/futurelink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-05T09:12:55.000Z","updated_at":"2024-07-06T09:50:03.000Z","dependencies_parsed_at":"2024-06-27T21:56:17.831Z","dependency_job_id":null,"html_url":"https://github.com/futurelink/msla-imaging","commit_stats":null,"previous_names":["futurelink/msla-imaging"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/futurelink/msla-imaging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurelink%2Fmsla-imaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurelink%2Fmsla-imaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurelink%2Fmsla-imaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurelink%2Fmsla-imaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futurelink","download_url":"https://codeload.github.com/futurelink/msla-imaging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurelink%2Fmsla-imaging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28857210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","3d-printing","msla","pcb"],"created_at":"2026-01-29T00:13:06.921Z","updated_at":"2026-01-29T00:13:06.983Z","avatar_url":"https://github.com/futurelink.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"mSLA 3D-printer file processing library\n======\n\nThis library was inspired by UVTools (chaps, you did an enormous amount of work reversing all that file formats!).\nInitially the idea was to write a tool that can display one image on mSLA printer's screen so\nthat I could get PCB done without any photo-printing.\n\nThe development is still in progress, I haven't tested files that this library can\ngenerate, although tried with Anycubic Photon 6K that I have.\n\nSupported mSLA file formats:\n- Photon workshop (PW0 codec supported, PWS is not)\n- Creality (CXDLP)\n- Chitubox (both encrypted and plain)\n- Elegoo GOO files\n\nPre-configured devices with defaults:\n- Anycubic Photon Mono\n- Anycubic Photon Mono X\n- Anycubic Photon Mono 4K\n- Anycubic Photon Mono X 6K\n- Anycubic Photon M3\n- Anycubic Photon M3 Max\n- Creality HALOT-ONE PLUS\n- Creality HALOT-ONE PRO\n- Creality HALOT-ONE\n- Creality HALOT-RAY\n- Elegoo Mars 4 Max\n- Elegoo SATURN\n- Elegoo JUPITER\n\n## API\n\nAPI is fairly straightforward, although it can be tricky in terms of setting\nvarious options for files. The main idea here is to provide versatile tool that\nallows setting options in machine-agnostic way.\n\n### Load a file\n\n```java\nvar file = FileFactory.instance.load('/path_to_file/file_name.ctb');\n```\n\n### Create a file\n\n```java\nvar machine = \"CREALITY HALOT-ONE PLUS\";\nvar defaults = MachineDefaults.getInstance().getMachineDefaults(machine)\n    .orElseThrow(() -\u003e new MSLAException(\"Machine has not defaults: \" + machine));\nvar file = FileFactory.instance.create(machine);\n```\n\n### Set file options\n```java\nvoid setOptions(MSLAFile file, MSLAFileDefaults defaults) {\n    var options = new FileOptionMapper(file, defaults);\n    options.set(MSLAOptionName.BottomLayersExposureTime, \"12\");\n    options.set(MSLAOptionName.LayerHeight, \"0.1\");\n}\n```\n\n### Extract layer data\n\nThe following code will save 2 images of layers 1 and 10 to current folder.\nDecoding is being done asynchronously, so it has to wait while working.\n\n```java\nvoid readFile() {\n    var temp_dir = \".\";\n    var file = FileFactory.instance.load('/path_to_file/file_name.ctb');\n    var writer = new ImageWriter(file, temp_dir, \"extracted_\", \"png\");\n    file.readLayer(writer, 1);\n    file.readLayer(writer, 10);\n    while (file.getDecodersPool().isDecoding()) ; // Wait while decoding-writing is done\n}\n```\n\nImage writer can be assigned with a callback:\n\n```java\nvoid decodeWithCallback() {\n    var layerPixels = new int[3];\n    var layerFiles = new String[3];\n    var writer = new ImageWriter(file, temp_dir, \"png\", (layerNumber, fileName, pixels) -\u003e {\n        layerPixels[layerNumber] = pixels;\n        layerFiles[layerNumber] = fileName;\n    });\n    for (var i = 0; i \u003c 3; i++) file.readLayer(writer, i);\n    while (file.getDecodersPool().isDecoding());\n    System.out.println(\"Layer 0 is in a file\" + layerFiles[0] + \n            \" and has \" + layerPixels[0] + \n            \" non-black pixels\");\n}\n```\n\n### Add layers from images\n\nLayers are added in the order of addLayer() calls, but encoded asynchronously.\nHence, have to wait until encoder is done its work.\n\n```java\nvoid addLayers() {\n    var pngFileLayers = new String[]{\"Layer_1.png\", \"Layer_2.png\"};\n    for (var pngFile : pngFileLayers) {\n        try {\n            file.addLayer(new ImageReader(file, pngFile), null);\n        } catch (IOException e) {\n            throw new MSLAException(\"Can't read layer image\", e);\n        }\n    }\n    while (file.getEncodersPool().isEncoding());\n}\n```\n\n### Extracting previews\n\nSome files formats support only one preview and some of them have more, \nso getPreview() receives preview index.\n\n```java\nvoid extractPreview() {\n    var file = FileFactory.instance.load('/path_to_file/file_name.ctb');\n    var image = file.getPreview(0).getImage();\n    ImageIO.write(image, \"png\", new File(\"path_to_preview/preview.png\"));\n}\n```\n\nThis example allows to get large preview. Depending on a mSLA file format\nthat is going to be the largest preview image available.\n\n```java\nvar image = file.getLargePreview().getImage();\n```\n\n## DISCLAIMER\n\nThis software is still in development, so you can use it on you own risk.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturelink%2Fmsla-imaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuturelink%2Fmsla-imaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturelink%2Fmsla-imaging/lists"}