Export Photoshop Groups as separate images - javascript

I'm currently working with several different Photoshop files. They all contain up to 10-40 Groups with even more layers. I want to export every group as an "image for web" in a different size than the document size.
Basically this is quite simple and should work like this in pseudo-code:
for i = layerGroups; i > 0; i--;
export layergroup[i] for web with "width=200 and height=120"
I'm experienced in javascript coding, however, I've never coded a Photoshop script yet, so this is where the difficulties begin. Hopefully, I could render out my problem and get some helping hands.
Cheers

Related

How do I include images array in Scrollama.js project

I'm very new to coding and for one of my classes we're doing a project that consists of creating a webpage with a scrollytelling element using scrollama.js. I found a side sticky template online that I'm trying to use, but I can't figure out how to set it up so that a new image shows up when a new box hits the trigger line on the page. My professor set up a boilerplate example here, but it doesn't have the layout I want and I can't figure out from looking at his example how he set up the array of images. To be clear, I don't want my images in the background like in the boilerplate example, I want them in the sticky window that's on my project,
Here is the Code Pen of my project.
From what I read, I thought I could alter this line:
sticky.querySelector("p").innerText = el.dataset.step;
But, I've tried variations of different things with no success.
If anyone can help it would be much appreciated. Also, I'm likely wanting to set up a few different sections of scrollama on the page, so if anyone has any advice on setting that up too please let me know.

How to improve OpenCV background drop from two images

I am using OpenCV with NodeJS (opencv4nodejs) and am attempting to replace background from webcam pics (one with and one without head in the frame).
My code works but the quality of the mask is useless presumably because I need to apply better filters but I am not sure what.
Here's my simple code
const bgSubtractor = new cv.BackgroundSubtractorMOG2()
const back = cv.imread('/app/src/services/back.jpg').bgrToGray()
const face = cv.imread('/app/src/services/face.jpg').bgrToGray()
bgSubtractor.apply(back)
return bgSubtractor.apply(face)
I've gray scaled them but that's about it. I'm not attaching particular images as I want to see if I can make a generic model but the intention is to replace the background from someone taking a headshot with their cam then asked to drop out for the background (which could vary) shot. I am not sure it's possible to obtain a decent quality with just two images though.
Perhaps a different would be better? I assume that if I could properly align the images to account for minor shifts between stills and subtract but perhaps that's what the cv.BackgroundSubtractorMOG2 does? I've worked from a few examples that use movies but the results didn't pan out well.
As #rayryeng pointed out, MOG2 Bg Subtractor needs to be trained with several background samples in order to be able to understand what a background actually is.
Try in this way:
take several background images (pretty obvious :) )
feed with them the MOG object with a
learning rate > 0
apply trained MOG to your frame with learning rate
= 0 to retrieve foreground objects
Very useful link that explains everything

Lottie - INTERACTIVE web based animation with raster IMAGES

I'm new to Lottie, have had some tutorial and tests completed, and got fascinated with the idea of mixing together After Effects animation with HTML5 animation. THANK YOU AB&B GENIES!
We're about to develop an online interactive project in which we'll cover our client's fashion collection.
The problem is, we'll have to use raster PNG images, rather than AE vector, because the client's got an exclusive waterpaint guideline for images.
Please have a look in this (closest) example of image ->Fashion woman waterpaint
We'll have different models (male and female) standing in idle position. Like, breathing, moving a little bit, like they're alive. We're planning to have their body parts and clothes in raster PNG images, animated with AE and exported with Lottie Bodymovin.
Then, we'd like to have [BUTTONS] which would help out the user to change these models clothes, like experimenting new fashion styles, colors, stamps, etc. A limited and pre-set range of PNG clothes will be used, to cover up the new collection.
How does Lottie work with changing such pre-set images, when clicking a button on runtime? Is it possible? The application will be hosted on an online server, and played on browser for an specific event, so no need to think about android or ios this time.
I'd like some references, please, I'm a bit lost around LottieAnimationView and setImageAssetDelegate, both which I can't see how to implement - if those are the proper solutions.
Thank you guys!

css-sprites vs inline/javascript

I'm doing a website which displays lots of little icons (stars, flags, folders...)
Now I'm using the CSS sprite technique and it works great but it's hard to mantain.
I'm thinking on making a big .js file with all images encoded as javascript variables. Then display the images this way:
images.js
var myimage1 = 'data:image/png;base64,iVBORw0KGgoAAAANS...';
var myimage2 = 'data:image/png;base64,cB324CD64aB3Cme23...';
html code
<script type=text/javascript src=images.js></script>
....
<img src="javascript:myimage1">
<img src="javascript:myimage2">
I know that the .js file would be bigger but it's very easy to maintain and it will be cached by the browser.
It's a good or bad idea? Is this cross-browser?
Stay with CSS sprites. If your users have JavaScript disabled, they won't see the images.
If you decide to stick with CSS sprites (because you require IE6/7 support, for instance, or are concerned about no-JS fallback), a few things that might help with maintenance:
Organize sprites into separate images based on shape. For instance, put all of your 20x20 badges in the same sprite, all your 30x15 folders in another sprite. (Yes, you will have more HTTP requests, but HTTP performance is one of many factors to consider.) This makes calculating CSS much simpler. You can set the sprites up as single columns, double columns (which is nice for roll-over effects) or whatever keeps things cleanest. Dealing with a large, irregular sprite is a pain!
Have a low-impact pattern for adding new imagery. Always add new items to the bottom, for instance, so you don't need to recalculate CSS for imagery above the new image. (This really only makes sense if you organize sprites per my first point.)
If you are no longer going to use sprites, just blank them out. Leave white spaces or gray x's or something in their old spot. Then when you have time and a bunch of removed images to clean out, do them all at once. (Again, if you're crazy concerned about performance, you might not like the idea of leaving any spare bytes in these files...)
Just a few thoughts.
Just think, would you rather see this:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAIRRJREFUeNrs3U%2BMHNd9J%2FAaznANcSmTkHSgnZHCQ0QqOZFG7EtgZxAjlwWI6BRgb84e9rILOL5sDjmIPiywe7IDJMckvgXJScYAuQSOm174IgEieRI51qHJoSUCO2OTonYocbq7tqs5TQ9p%2Fpnuqa5Xr36fD9AQfPGwX3VVfd%2BrX%2F1eUZCbn44%2F5YI%2BFxfw7724wH%2FvT1vwb8jhc7El4%2FTr8ed0w%2BfL2w2M71pLzofS5ZFZHDEEQENOjj8%2FaPjv%2FaNhBwEASO%2FtvU8T3tkLAYAAALTADxq4MZ8bf%2F7SUIMAALTH6QZuzj8wzCAAAO3zTrG4gsDvFLMV5oEAANCgRRToNV1oCAIAwIyqWXrdBYFN1BeAAABQwypAXTfsKlB8x5CCAAC0X3Xzf6fG2T8gAACZqN4IONeC%2Fw8QAAAadpjZe52rCCAAADRorZi%2FN0CddQQgAAA0bJ7WvVVweNvQgQAA5Gued%2Fht9gMCANAB3ykO3sXvYtH89sIgAAAsyEFWAaob%2F3cNFQgAQHec25vdP4%2FCPxAAgA76bvHs5f2q6G%2FNEIEAAHTPswoCbfYDAgDQcU%2Bb6f9lofAPBACg8%2Fa%2F5lfd%2B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4EADociA4XSgmJK5%2BoXgPAQAUExJCr1C8hwAAL1wdWCsUE5K36Tv5ivcQAGDOQKCYkBwo3kMAgAWGAcWEtG2WX93w37WsjwAAzQaC04ViQprTf2KWr3gPAQBaEgj2rw4oJqQO%2B3fQM8tHAIBMVgfWCsWEzEbxHgIAdCwQKCbkaRTvIQBAoDCgmDC2yQy%2FULyHAADhA8HpQjFhl%2FULxXsgAMABAsH%2B1QHFhHl6d98sv284QACAeVYH1grFhG03Ld77sQ11QACARQQCxYTtcKd4%2FBU9s3wQAKCxMHDyidWB00ZloXqF4j0QAKCFgeD0E6sDHhccTr9QvAcCAGQYCKoQoJhwNor3QACAToWBk8XjrxpaHXhI8R4IABAqEJwrHm9GFMWdJ2b5lvVBAIDQqwNrRXeLCScz%2FMKGOiAAAM8NBKeLvIsJ%2B8Xjr%2BiZ5YMAAMwRCKoQ0OZiwumGOor3QAAAFhQG2lJMqHgPBAAgYSBoqphQ8R4IAECLVwfWivqKCScz%2FELxHggAQFaB4HQxWzFhfzrLH9%2Fw3zWCIAAA3QgEVQjYX0x454lZft8oQQz%2FX4ABAK6DJElxTemaAAAAAElFTkSuQmCC
or this:
<img src="islifethissimple.png" />
Remember that:
Javascript can be disabled.
Data urls may reduce 2 requests per image, but they are lengthy.
Data url images are not cached so the user would be requesting the full page each visit (entirely true?)
Need to make one small change in the image? You'll need a complete new data url. In an image sprite, all your images are used in one file and can be easily edited.
I would say that it's a bad idea as none of your images would show up if the user has JavaScript disabled. Yahoo! reckon that about 2% of their visitors don't use JavaScript (source)

Would Like Multiple Checkboxes to Update World PNG Image Using Mogrify to FloodFill Countries With Color

I'm seeing in another forum if the best way to do this is with Javascript or Ajax but I'm wondering if there is an even easier simpler way. I'm trying to create a web service where users can check which countries they have visited from a list of 175 or so and a World map image would then instantly update with a filled color.
There are other similar services, but I'm envisioning mine to be both updating from checks in checkboxes and by clicking on the target country in the displayed image say with an imagemap. Additionally other solutions display all the visited countries in the same color. I would like different colors for different countries or at least for those countries that touch. Eventually I would like to include a feature that enables the choice of which colors to assign countries.
I found a Sourceforge project called pwmfccd. It's simply an open source image of the world and the coordinates on the PNG image for all the countries. You can use mogrify from ImageMagick and floodfill to fill the countries with color. I have done this successfully, locally with batch files.
My ISP has told me where mogrify is located, basically "/usr/bin/mogrify". I now have a horrendously complicated cgi script which if it worked is set to redraw the world map image with each checkbox. It's here. It also redraws the whole web page with each check. The web page starts here. Of course this is not at all efficient, and I think probably the real way to go is Ajax or Javascript, so that maybe just the image gets changed and redrawn, not the whole web page. Sorry I don't even know the difference between Javascript and Ajax and their relative merits at this point.
I suppose you could make just one part of the image update with each check or click on the image instead of even just the image redrawing, but I have never even heard of a hint at being able to do that for irregularly shaped image elements like countries. So I guess an Image map and sister checkbox entries tied to mogrify events redrawing the user's personal copy of the image with an image refresh would be the only way to go.
So how do you do this with something other than Javascript or Ajax or is that definitely the way to go and if so, how would you do it? Or can you after all cut up a web based image into irregular puzzle shaped piece which you can redraw individually at will.
Thanks in advance for reading and considering answering this post.
Well, it looks like maybe my hosting company only supports using PHP with ImageMagick. At least I know better what to try create. I'm completely new to PHP, but I guess that is alright

Categories