Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image looking pixelated on higher resolution screens #108

Open
nicolasdupouymanescau opened this issue Nov 7, 2023 · 4 comments
Open

Image looking pixelated on higher resolution screens #108

nicolasdupouymanescau opened this issue Nov 7, 2023 · 4 comments

Comments

@nicolasdupouymanescau
Copy link

Hello, it looks like the image gets pixelated whenever the scriptUI is used on a 2k or 4k monitor.
Here's what I mean :
4k monitor :
image
2k monitor (1920x1080) :
image

I was wondering if you can change its interpolation to something smoother such as bilinear within the encoding method that is used by the script ?

@joonaspaakko
Copy link
Owner

joonaspaakko commented Nov 7, 2023

SUI does have high dpi image substitution, but I don't really have any experience with it. This thread links to an example and suggests it might not work all that well. I don't think you could make it work with binary images, but you can... and pretty much have to customize the dialog afterwards, so you could try to add the images yourself from a file path rather than an embedded image. If that doesn't work, I'm not sure what you could do... Other than maybe use UXP.

@nicolasdupouymanescau
Copy link
Author

SUI does have high dpi image substitution, but I don't really have any experience with it. This thread links to an example and suggests it might not work all that well. I don't think you could make it work with binary images, but you can... and pretty much have to customize the dialog afterwards, so you could try to add the images yourself from a file path rather than an embedded image. If that doesn't work, I'm not sure what you could do... Other than maybe use UXP.

if I take the same image with higher DPI and convert it to binary with your dialog builder, it appears very big and I don't like it. Is there any way the image can be uploaded that way but resized within the binary or maybe with a line of code ?

@joonaspaakko
Copy link
Owner

joonaspaakko commented Nov 8, 2023

That's what I was saying about adding the images yourself. I don't see a way for the image substitution to work unless the source is an image path, which is not something you can do with SDB (ScriptUI Dialog Builder) directly, since it can only embed them.

I suppose there could be a way to detect "the need for a high dpi Image" and replace the binary image with Javascript.

I would try the image substitution using filenames talked about in the selected answer, since that is at least somewhat natively supported. ScriptUI for dummies pdf and Javascript tools guide pdf should have examples on how to add an image, in case you're not sure how. I'm not saying you shouldn't make the dialog using SDB, but rather edit it afterwards: make the dialog with SDB using placeholder images and then after exporting it remove the images using Javascript and replace them with file paths. Or don't place any images In SDB and just put them in using Javascript. And of course use the filename suffix @2X.

@nicolasdupouymanescau
Copy link
Author

Finally did I find my way creating a polygon path and, for the implementation, using some code directly from the BattleStyle_tester from adamplouff (see his GitHub) The only thing is that it's a lil bit unstable.
So did I find this also, whish I haven't tested yet, but I think it's ideal: https://bitbucket.org/rendertom/workspace/snippets/xn8k4X/scriptui-retina-image
Do you think you can implement that retina image solution in your script Dialog Builder tool ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants