Skip to main content
jasonw65411213
Participant
January 14, 2019
Question

Need Help to Set Transparent Background

  • January 14, 2019
  • 2 replies
  • 488 views

Hello,

I’m currently developing a UI using the photshop utility shown here https://www.creativesystems.com/playground-toolkit/

I’m having some trouble setting the background to be transparent. I’ve seen on other sites such as https://www.termaheat.pl/grzejnik/bart (scroll about halfway down the page and click the 3d tab to load the model) where the .viewer class in the iframe has a transparent background set via the embed css
.viewer.transparent { background: rgba(0, 0, 0, 0) !important; }

where on my example the .viewer class has this style applied to it
.viewer.transparent-pattern {
background-color: rgb(255, 255, 255);
background-image: linear-gradient(45deg, rgb(204, 204, 204) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0)
75%, rgb(204, 204, 204) 75%, rgb(204, 204, 204)), linear-gradient(45deg, rgb(204, 204, 204) 25%,
rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 75%, rgb(204, 204, 204) 75%, rgb(204, 204, 204));
background-position: 0 0, 4px 4px;
background-size: 8px 8px;
}

I’m not sure how this is achieved because I have the model background turned off in photoshop which gives it the transparency image instead of no background at all. Any help would be greatly appreciated.

-Jason Walter

This topic has been closed for replies.

2 replies

JJMack
Community Expert
Community Expert
January 14, 2019

Photoshop Background layer does not support transparency and  the background swatch contains a color.   You can create a document without a background layer where the bottom layer will be clear transparency, or convert the background layer to a normal layer and delete(clear) the color in pixels in the normal layer.  These Pixels will be Transparent if you save the Document in an image file type that supports transparency like a PSD, PGN and others.  Jpeg File format does not support transparency though. Pixels do not need to be perfectly clear they can be partly transparent opacity less than 100%.

var doc = app.documents.add( width, heigh, resolution, "Document Name", NewDocumentMode.RGB, DocumentFill.TRANSPARENT, 1, BitsPerChannelType.EIGHT, ColorProfile.CUSTOM or WORKING);

JJMack
January 14, 2019