Skip to content

Commit

Permalink
Make sure priority mask can't enable transparent pixels (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleEndu committed Jul 19, 2023
1 parent 3fe2f22 commit 74591fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions canvasFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export function ditherData(imageDatas: ImageDataWithCoordinates[], priorityData:
for (let i = 0; i < frameWidth; i++) {
for (let j = 0; j < frameHeight; j++) {
let rgba = getHighestRGBA(imageDatas, i, j)
if (rgba.a < ALPHA_THRESHOLD)
continue
let imageIndex = (j * frameWidth + i) * 4
let middlePixelIndex = ((j * 3 + 1) * rv.width + i * 3 + 1) * 4;
let alpha = priorityData ? priorityData.data[imageIndex] : rgba.a
Expand Down
4 changes: 3 additions & 1 deletion dist/templateManager.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

// ==UserScript==
// @name template-manager
// @version 0.5.6
// @version 0.5.7
// @description Manages your templates on various canvas games
// @author LittleEndu, Mikarific, April
// @license MIT
Expand Down Expand Up @@ -293,6 +293,8 @@
for (let i = 0; i < frameWidth; i++) {
for (let j = 0; j < frameHeight; j++) {
let rgba = getHighestRGBA(imageDatas, i, j);
if (rgba.a < ALPHA_THRESHOLD)
continue;
let imageIndex = (j * frameWidth + i) * 4;
let middlePixelIndex = ((j * 3 + 1) * rv.width + i * 3 + 1) * 4;
let alpha = priorityData ? priorityData.data[imageIndex] : rgba.a;
Expand Down
6 changes: 5 additions & 1 deletion osuplace2023.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@
],
"blacklist": [
{
"name": "r/osuplace",
"name": "old r/osuplace",
"url": "https://rentry.org/osuplace2023/raw"
},
{
"name": "old r/osuplace",
"url": "https://rentry.co/osuplace2023/raw"
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "template-manager",
"version": "0.5.6",
"version": "0.5.7",
"description": "Manages your templates on various canvas games",
"main": "main.ts",
"scripts": {
Expand Down

0 comments on commit 74591fe

Please sign in to comment.