MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
going
Recherche

macOS Shortcuts: Add a Watermark To an Image

mardi 30 novembre 2021, 17:00 , par MacMost
Learn more about creating your own Shortcuts by following along with this watermark tutorial. Build a Shortcut that will add an overlay to an image file and save the file to the same location with a new name. This can be the basis for all sorts of image modification Shortcuts.



Check out macOS Shortcuts: Add a Watermark To an Image at YouTube for closed captioning and more options.
Video Transcript: Hi, this is Gary with MacMost.com. Today let me teach you how to create a shortcut that adds a watermark to an image.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us and get exclusive content and course discounts.
So I'm going to show you how to use the Shortcuts App in macOS Monterey to allow you to take an image and apply a watermark to an overlay image that will appear in a corner. While that may seem like the real goal here the actual goal is for me to teach you how to do some things in the Shortcut's App. We're going to look at each action as we add it and why we're adding it and what it does.
So first we're going to start off in a completely different app because we need to make a watermark. So I'm going to start off here in Pixelmator Pro but you can use any image editing app you want or grab a graphic off the internet. I'm going to create a small little graphic. Let's make it 200 pixels wide by 50 pixels high. Create it and then I'm going to use this as the watermark. I'll add some text in here to make it fit into the space here and then let's add a shape like a little start and then I'll make that fit in as well. Then I'll delete the background layer so this is a transparent image here. This is what we're going to use as our watermark. Okay. So now I'm going to export this in a format that supports transparency. So I'm going to do png here and I'm just going to save it to the Desktop as Watermark. Now we can see it right here. If I look in QuickLook I can see how it's transparent right there. But let's not leave this here cluttering up our Desktop. I'm going to go into the Documents folder and put it under Miscellaneous here. Just some place where I can permanently lift since the shortcut is going to be calling on this png all the time.
Now let's run the Shortcut's App and create a new shortcut. Let's call it Add Watermark. You can customize the color and the icon if you like. The first thing we want to have is we want to set it so that it's a Quick Action and appears in the Finder. So it's something where we can select an image and then call on this Quick Action to add a watermark. This will add Receive Any Input from Quick Actions up here. We don't want ANY. So I'm going to select that and do Clear. Select it again and do Just Images. If there's no input we could set it to Ask For so it will ask for, let's ask for a file. So if you just were to run this normally and not select an image first it would know to ask for a file to perform this action on it.
Now this Shortcut input here is going to be the image. So all we need to do is overlay something on top of that image. Let's look for overlay and we could see there's overlay text, overlay image. That's what we want. So I'm going to double click to add that. It's going to overlay an image on an image. So the On part here is going to be the Shortcut Input. The overlay part is actually going to be a file. We haven't gotten that file yet. So let's go and look for an action that has to do with files. We'll do File here and we'll drag it before this and then I'll click here and it will ask us to select the file. So now we can go to that Miscellaneous folder. We can put the watermark right in here. We'll select it. So there's this file. So now overlay what? Well let's click here and say Select Magic Variable. Click the file that comes out of this action. So overall file on Shortcut Input. Let's click Show More. Show Image Editor is checked. Let's leave that checked for now and see what we get.
So if I were to Hide Shortcuts and bring up an image, so here's an image on the Desktop, I'll Control Click on that, right click or two finger click on the trackpad, you could see under Quick Actions there's Add Watermark. Let's try it. Let's go into Run the Shortcut and since we have the editor appear it's going to bring up this Editor here. Now we can drag the overlay to wherever we want. So I can put it here at the bottom right hand corner. I can actually even use the trackpad to pinch in my fingers to shrink it down, place it just where I want and then I could set the opacity too if I want it to fade out a bit. When I'm done I can hit Done and that's it. We didn't Save it anywhere so it do anything. It didn't replace this image. This is still the same.
So one thing we can do here that's really simply is bring up Quick Look. So Quick Look will take the results of this and we'll see it will say Show Overlay Image in Quick Look. So now if you were to do the same thing and do the Quick Action here, add a watermark, bring it down here, shrink it, put it right there, hit Done it's going to bring up the result in Quick Look. Then we can use the Share button here and we can share it to Mail, Messages. We can open it in Preview and if we open it up in Preview now we can Save it. So a lot of times you'll see Shortcuts use this Quick Look action to end things and to give whoever is using the shortcut the ability to do all sorts of things with the resulting image.
But we want to do better than that. First of all we want to have it automatically put the watermark there and not bother us with positioning it and scaling it. Second is we want it to have it automatically saved to a new file at the same place as the original file, just with a slightly different name. So first let's get right of Show Image Editor. If I turn that Off there are a bunch of different options like where to position the overlay. So we want it to position it to the bottom right. So we'll choose this. We're going to check it out in a minute here to see why that's not quite correct. Then we can make it semi-transparent if we want. We can rotate it. We can change the width and height if the image is too big. So now it shouldn't bother us with that editor there. We can use this, Quick Actions, Add Watermark, it should go right to Quick Look and it does. Unfortunately it doesn't quite work. It takes a little too long for it to apply the overlay and Quick Look doesn't get the results.
So let's instead of viewing this in Quick Look let's save it as a file. So to do that do Save and get Save File. So it's going to save the overlay image. We do Show More and Ask Where to Save. So, let's try this now. I'll do Quick Actions and then Add Watermark and it's going to ask us where to Save. I'll just choose the Desktop here and we can see we get the second image here. If we look we can see there's the watermark. Notice it's at the top right, not the bottom right. Remember I mentioned that before. Yeah, there seems to be a little bug here. You want to set this to top right for it to be on the bottom right for some reason. Probably something that will be fixed at some point in the future.
Now what if instead of prompting us where to save the file it just did it! Well, it turns out that's a little more complex than you would think. But we can do it. First thing is we need to get the path of the original file and the name of the original file. So let's look at File here and there's one for Get Parent Directory. We're going to use that. We're going to stick it up here right at the top. Get Parent Directory what? Well we're going to Control Click here and say Shortcut Input. So the Parent Directory or Shortcut Input. Great. Now let's also look for File Details. There's Get Details of Files. Let's put that under here and say well, let's get the Name of what? Well let's get the name of the Shortcut Input. So we have two things here. Parent Directory and then Name. Great. So, instead of Ask Where to Save here at the bottom, let's turn that off, and instead Save Overlay Image To where? Not the Shortcuts Folder, let's Control Click that and say Magic Variable and then let's go to Parent Directory of the Shortcut Input. There we go. So save it to the Parent Directory. Now Subpath is a fancy way of saying the Name of the file but you could include more like subfolders and things.
So what we're going to do is start off here Control Clicking inserting a variable and we could just select Variable here just to make sure we're grabbing the right thing and grab the Name. Then we're going to Add a dash new and that will give a name with dash new after it. We can call it Dash Watermark or whatever we want. Then we could say Override a File exists. So if we do this a couple of times it's just going to override, it's not going to bother us about that. So now that we've got this let's try it out. Let's Control Click here. Quick Actions. Add Watermark. Now it's going to ask for permissions for the Desktop folder only the first time we do this. Now you can see it created this second file here. If I look at it you could see it's rainbow-new.jpeg. There is the watermark there at the bottom right. Now we can very easily add watermarks to files without multiple steps or anything like that. As a matter of fact if we look in the Finder here and then go to Desktop and then we bring up the Preview pane by going to View, Show Preview, we could even set this up as a Quick Action here. If you don't see it as one of the first two you can go to More and you could see it there or customize to make it one of the first two Quick Actions.
So I could just have this one here, select it and click that. It will create this new version here that has the watermark applied. Here's the complete thing. Remember that we definitely used under Show More here No Image Editor. We set it to the top right so it's in the bottom right and under Save we set the Subpath to the Name dash new and turned on Override if the file exists. Turned Off Ask where to save. You can continued to build on this. Instead of just doing an overlay you can have more things. For instance, if you look here under Media you could see that there's a whole bunch of different things here. Cropping, Flipping, Rotating Images, Resizing Images. You can convert images if you want. If you have other apps installed you may see even more. For instance Pixelmator Pro here will add a whole bunch of actions that you could perform on images. You can certainly add these in in place of the overlay action or in addition to that as well.
I hope you found this shortcut useful or at least as a useful starting point for creating your own shortcut. Thanks for watching.Related Subjects: Shortcuts (27 videos)
Related Video Tutorials:
macOS Shortcuts: Capture Text From Your Screen ― Create an iPhone Shortcut To Show Your Vaccination Card ― An Introduction To Shortcuts On The Mac ― 10 Quick and Easy iPhone Shortcuts

You can download the Shortcut here.
https://macmost.com/macos-shortcuts-add-a-watermark-to-an-image.html
News copyright owned by their original publishers | Copyright © 2004 - 2024 Zicos / 440Network
Date Actuelle
ven. 26 avril - 10:58 CEST