• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is it possible for a ScriptUI iconbutton to have @2x PNG or SVG icons? My icons are pixelated.

Contributor ,
Dec 05, 2019 Dec 05, 2019

Copy link to clipboard

Copied

I'm building a simple ScriptUI toolbar with icon buttons…

 

var theIcon = myPanel.grp.group1.add("iconbutton", undefined, "~/icons/renderfarm.png",{style: "toolbutton"});
theIcon.size = [22, 22];
theIcon.onClick = function() {
}

 

 

Problem is, they look fuzzy and pixelated on my MacBook Pro with its high dpi Retina Screen. If this was a website I was building, I would simply use a separate "icon@2x.png" or simply use a single image that was twice as large as I need it and scale it down in css. Or use SVG. Are any of these options available in ScriptUI?

 

I can't find *any* information online about how to address this issue, such as how to scale an icon to 50%. When I adjust theIcon.size it just changes the size of the containing box, and even just crops the icon if the box is too small.

 

I see 3rd party scripts with nice smooth icons so I'm curious how they're achieving this.

TOPICS
Scripting , User interface or workspaces

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Feb 19, 2021 Feb 19, 2021

ScriptUI should support the `@2x` suffix, according to https://helpx.adobe.com/au/photoshop/using/ScriptUI.html#HiDPIsupport

 

Best,

Marc

Votes

Translate

Translate
Contributor ,
Dec 05, 2019 Dec 05, 2019

Copy link to clipboard

Copied

You will want to have all of your icon sizes predefined as there is no real way to scale like in HTML, and the usual size for icons is 25-35px on the low end.

 

As for achieving smooth icons and different looks, that's all internal scripting using event listeners and multiple images with ON and OFF states. We all have the same types of elements and buttons to work with, and it's just a a matter of how creatively you choose to use them!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 05, 2019 Dec 05, 2019

Copy link to clipboard

Copied

Thanks Nathan. Good to know I'm not missing something haha.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

ScriptUI should support the `@2x` suffix, according to https://helpx.adobe.com/au/photoshop/using/ScriptUI.html#HiDPIsupport

 

Best,

Marc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

Neat! I assume this was added after I originally posted. I'm sure I tried that back then and it didn't work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

Oh wait, just noticed that your link is for Photoshop, not After Effects. Can anyone confirm that this now works in AE too?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Hi Mark,

 

I have no idea in which context this, hum, “feature” is supposed to work 😕

 

For the time being, all tests in ScriptUI for InDesign CC 2021 (16.1) failed, but it is well known that ID has specific problems with HiDPI displays, so maybe the trick would work in AE…

 

Best,

Marc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

nope, sorry, this doesn't work for AE.

Best we can do in regards to vector icons is to use BattleStyle from Adam Plouf  https://github.com/adamplouff/scriptui-battlestyle

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 20, 2021 Apr 20, 2021

Copy link to clipboard

Copied

giphy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 20, 2021 Apr 20, 2021

Copy link to clipboard

Copied

Because ScriptUI was released way before the HiDPI displays where released into market.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 07, 2023 Apr 07, 2023

Copy link to clipboard

Copied

LATEST

Hi Tomas, How can i get the coordinates of my svg file so i can create the icon as a vector in my script interface?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines