{"schemaVersion":1,"id":"recommended.sm-image-editor","version":"1.0.0","name":"Image editor workflow","description":"An editable production workflow using Image editor v2.0.0.","stages":[{"id":"main","blockId":"sm.image-editor","version":"2.0.0","label":"Image editor"}],"connections":[],"packages":[{"manifest":{"schemaVersion":1,"sdkVersion":"0.1.0","id":"sm.image-editor","version":"2.0.0","name":"Image editor","description":"Adjust image brightness and contrast in the StillMade pixel sandbox while preserving dimensions and alpha.","kind":"workspace","runtime":"javascript","entry":"src/run.js","license":"MIT","provenance":{"notice":"Original source (authorship declared by the packager)\nLicense: MIT\nChanges: Original implementation declared by the packager; no reused repository or dependency code.\nFiles: LICENSE, src/run.js\n\nMIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","portableSources":[{"kind":"original","license":"MIT","paths":["LICENSE","src/run.js"],"evidence":["upstream/0/LICENSE","upstream/0/src/run.js"],"changes":"Original implementation declared by the packager; no reused repository or dependency code."}]},"inputs":{"input":{"type":"image","primary":true,"imageMode":"pixels","description":"The image to adjust."},"brightness":{"type":"number","default":0,"min":-100,"max":100,"description":"Darken or brighten RGB channels."},"contrast":{"type":"number","default":0,"min":-100,"max":100,"description":"Reduce or increase tonal separation."}},"outputs":{"output":{"type":"image","primary":true,"description":"A new adjusted image with the original dimensions and alpha channel."}},"permissions":{"project":[],"network":[],"filesystem":[],"secrets":[]},"ui":[{"port":"input","control":"asset"},{"port":"brightness","control":"slider"},{"port":"contrast","control":"slider"},{"port":"output","control":"before-after","before":"input"}]},"code":"const clamp = value => Math.max(0, Math.min(255, Math.round(value)));\nconst brightness = input.brightness * 2.55;\nconst contrast = input.contrast;\nconst factor = (259 * (contrast + 255)) / (255 * (259 - contrast));\nconst data = input.input.data.slice();\nfor (let index = 0; index < data.length; index += 4) {\n  data[index] = clamp(factor * (data[index] - 128) + 128 + brightness);\n  data[index + 1] = clamp(factor * (data[index + 1] - 128) + 128 + brightness);\n  data[index + 2] = clamp(factor * (data[index + 2] - 128) + 128 + brightness);\n}\nreturn {output: {width: input.input.width, height: input.input.height, data}};\n","tests":[{"name":"Raise brightness while preserving alpha","input":{"input":{"width":2,"height":1,"data":[10,20,30,255,240,250,255,128]},"brightness":10,"contrast":0},"expected":{"output":{"width":2,"height":1,"data":[36,46,56,255,255,255,255,128]}}},{"name":"Neutral adjustment is pixel exact","input":{"input":{"width":1,"height":1,"data":[42,84,126,200]},"brightness":0,"contrast":0},"expected":{"output":{"width":1,"height":1,"data":[42,84,126,200]}}}],"portable":{"format":"stillmade-block/1","dependencies":[],"sources":[{"kind":"original","license":"MIT","paths":["LICENSE","src/run.js"],"evidence":["upstream/0/LICENSE","upstream/0/src/run.js"],"changes":"Original implementation declared by the packager; no reused repository or dependency code."}],"files":{"upstream/0/LICENSE":"MIT License\n\nCopyright (c) 2026 StillMade contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","upstream/0/src/run.js":"const clamp = value => Math.max(0, Math.min(255, Math.round(value)));\nconst brightness = input.brightness * 2.55;\nconst contrast = input.contrast;\nconst factor = (259 * (contrast + 255)) / (255 * (259 - contrast));\nconst data = input.input.data.slice();\nfor (let index = 0; index < data.length; index += 4) {\n  data[index] = clamp(factor * (data[index] - 128) + 128 + brightness);\n  data[index + 1] = clamp(factor * (data[index + 1] - 128) + 128 + brightness);\n  data[index + 2] = clamp(factor * (data[index + 2] - 128) + 128 + brightness);\n}\nreturn {output: {width: input.input.width, height: input.input.height, data}};\n"},"lineage":{"parents":[],"changes":"Packaged original Block source for StillMade."}}}],"license":"MIT"}