What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How to remove jagged lines?


Koo

Member
Messages
5
Likes
0
Hello Im using photoshop CS and i have an image which is 687x518 and I enlarged it to 1024x780 using photoshop CS and the image has jagged lines . The question is , can I remove them? If I can, how?
 
It depends on what exactly you want to achieve (perfection of simply acceptable).
The technique is rather complicated as you have to create an edge mask. This means that with a mask you tell photoshop which pixels it may affect, say, blur, and which ot, and in what degree if you have greys/ soft transitions.

This said, is the image a jpeg?
When you enlarge an image in Photoshop or any other pixel-based graphics application (PaintShop Pro, the Gimp,...) you actually tell the software to create new pixels for you. In your example you have 687 pixels at your disposal, each pixel with its own data about colour, and you tell PSCS to nearly double that number. These new pixels are empty, and CS must create colour values based on the existing neighbouring pixels.
CS has good algorithms to calculate, but a decay in quality is inevitable. Upsampling should always be avoided as you would the black pest.
When there is no alternative, the best way to get acceptable results is to upsample in small steps, and taking care you never take an easy step like doubling.

Are you familiar with masks and selections?
 
Well the image is indeed jpeg and I am just a photoshop noob I have never used masking before , I only use photoshop for simple croping and designing and enhancing pictures using the enhancing trick found on this particular forum. :)
 
OK. Give me twelve hours and I'll explain it to you in a way that you know the how and the why.
I don't have PS here at my disposal, so I cannot make any screenshots now.

About masking:

Part one:

-First thing to know is that a computer has no eyes and cannot interprete. It only can stock into its memory and do some very complicated calculating.
-To be able to store something into its memory (which knows only on and off, one or zero, black or white) it needs to be chopped into pieces. When talking about images, these pieces are called pixels. An image is cut into squares like a mosaic, and from each square (pixel) the computer remembers its place (like: third row, fifth pixel from the right), and also its colour. Colour is also cut into three components, Red, Green and Blue. These are called "primaries" and with them you can create any colour a computer can show, and even more.
-A pixel has no fixed size. You decide (Imgae>size, change the resolution) how big or small they are. It is obvious that the more pixles you have in every inch, the more detailed the information can be.
-As a side note: It can be a bit confusing as a monitor also displays pixels, 72 or 96 of them in an inch. The size of these cannot be changed. So when you have set the resolution of your image to, say, 300 pixels in every inch, your monitor will display this image like as it were four times as large. But this does not affect its quality. For a monitor or the internet, only the number of pixels is important, not how many there are in an inch as the monitor itself always displays 72 or 96 in an inch, whatever your settings.

Part two:

-As seen, an image that you see on a monitor is like a mosaic of pixels.
-Photoshop offers you the option to choose any number of these pixels and save them as a selection. A selection literally means: I choose this, and this and this... pixel so I can do something with them.
-Masking is exactly the opposite. It means: I protect this, this and this...pixel against any changes I will do.
 
Koo said:
Ah i see , so how do I actually protect these pixels from being jagged?

Not a whole lot. When you resize you can use interpolation "bicubic smoother" (resize option) which can make a slight difference, you can smooth some areas by hand (local smudge, blur with a soft, small brush (low opacity) for example) or you can use a special plugin like Genuine Fractals (http://www.lizardtech.com/products/gf/) which might give you better results.

But in the end the image will always look worse.
It's like Erik said (and trust me, he knows what he is talking about): "Upsampling should always be avoided as you would the black pest.".
What ever method(s) you use to smoothen these jaggies, they're all about "guessing", either by Photoshop, a plugin or yourself.

I wish I had better news for you Koo :\
 
One trick I've used when there are just a few obvious lines or curves which need work is to use the Pen tool and draw a path along the line which looks pixilated. Then I set up the Blur tool to the right brush size, hardness, blend mode and Option (Alt) click on the Stroke Path button (second from the left at the bottom of the Paths palette). This brings up a window which allows you to stroke the path with a number of different tools, including Blur.

I've also tried an Anti-aliasing Plug-in from http://www.powerretouche.com/ but unfortunately give it a Ho-Hum rating.
 
Excuses for the delay, but urgent matters kept me away for a few days...
OK, back to business.

The jaggies are most visible on the edges, or, in other words: there where there is a rather harsh transition in tone. So what we can do is blur the edges. That way the effect will be less visible. For the mask we need a greyscale image that hides everything but rather soft "blurred" edges.

The procedure is as follows, and if there is a step you don't follow, do not hesitate to ask, ok? I do not mention shortcuts on purpose. They will come later on, but it is best to first know what they mean, and do. OK, let's go ahead and create a mask.

1/ First open the image you have upsampled in several steps so as to get the best effect possible.
2/ Image>Duplicate This duplicates your open image.
3/ Set the duplicate to greyscale (Image>Mode>Greyscale). Later on, when you have more experience, you may want to use a channel, but for now it is easier to use a greyscale image.
4/ The best way to get the edges is to use the appropriate filter: Filter>Stylise>Edges .
5/ Yet, to have a good mask that hides everything but the edges, we need to invert this. Image>Invert
6/ We want the edges to be more uniform. This we do with the Median filter. Filter>Median (a value of about 2 should be allright)
7/ We also want them to be thicker: Filter>Other>Maximum. Set this somewhere between 3 to 5, depending on your image.
8/ What we now want, is a softer transition. This we get by blurring: Filter>Blur>Gaussian Blur. Take the same value you chose for the maximum Filter.

Voil?, this is our mask. The advantage of duplicate is that you can now compare the mask with the original so that you see what you did.
OK. Now Select>All and Edit>Copy the mask you created.

Back to your original image now.
1/ Layer>Duplicate This creates a copy of the background (your image) on a new layer.
2/ With this layer active, Layer>Add layer mask>Reveal all . Tis creates a new icon to the left of the layer icon, a layer mask.
3/ Alt+Click on this layer mask icon and edit>Paste This pastes the mask you created on the white, empty, all revealing layer mask.
4/ Now click on the icon of the image at the left of the layer mask icon. This makes the image on the layer active. You can see that it is active because you'll see a brush icon to the left of it.
5/ Now use Gaussian blur on the image on the layer. The image itself will blur but only theoutlines as dictated by the mask will pass.

When you are happy with the settings, save, and then flatten and use save as to save a flattened copy.

Not ideal, but it does lessen the effect of jagged edges a bit.
 
Ah thank you erik on teaching me how to mask . I did try the plugins and they gave a better outcome but your idea on masking works as well :)
 

Back
Top