Jump to content

How do I move a Photoshop layer 1/2 pixel?


Recommended Posts


Thanks, Trip. If it were that simple, I would have known the answer. I just PM'd CoffeeFiend about this. Is he still active?

 

I've also searched for an answer on the internet, but haven't been able to find anything helpful. There must be some way to do it, else the other Photoshop YouTube channel art designers wouldn't be able to accomplish this. I also posted this question on a Photoshop forum I belong to, but, as yet, haven't gotten a response.

 

Perhaps I missed something in my internet search. Since you're familiar with Photoshop, would you mind doing your own search, when you have time, to see what you can find? And then just give the links for the topics that seem to give the answer. Of course, you don't have to do this, because I know your time is valuable to you.

 

Thanks again,

Larry

Edited by larryb123456
Link to comment
Share on other sites

@Tripredacus:

 

Thanks again. Is CoffeeFiend still active?

 

Does Fireworks open .psd files? I'm pretty sure it does. When I finish my YouTube channel cover art -- (it'll be at least a week or more, probably) -- can I send you my .psd file with 2 layers -- (the one in the middle with the graphics and the black background) -- and can you move the graphics layer 1/2 pixel so it is exactly centered, 508.5 px from top to bottom as in the diagram in my first post, and save it as a JPEG at the highest quality and mail it back to me? I can double check it with the measure tool. It's funny that in Photoshop, the measure tool, the ruler, can measure in small increments of pixels while the move tool only knows 1-pixel increments. To satisfy my curiosity, for you, what are the advantages of Fireworks over Photoshop? I use CS5, BTW.

 

Thanks again,

Larry

Link to comment
Share on other sites

Could you not scale it to double the resolution, move it 1 pixel, then sample it back down to the original size?

 

That would be presuming that Photoshop would actually put the pixels where you want them to be. It would be worth a test, but you may end up with unwanted results.

 

Regarding my use of Fireworks, it comes down to my usage history. I had an "LE" version of Photoshop 5 originally, it came with some hardware I bought. I first got a Macromedia Suite license from college for version 2 software (Dreamweaver, Fireworks, Freehand, Director, Flash, etc) and then one for MX 2004. I had used Fireworks 2 along with the Photoshop 5 LE and found that (at that time) the only real difference was that Photoshop has filters. I basically ditched Photoshop and only have been using Fireworks MX 2004. I have since used newer versions of Photoshop through work, such as CS3 but my familiarity with Fireworks makes it my goto application.

 

Regarding PSD files, it does support *some* ... it is version dependent. You probably would want to stick with a parallel version. IDK if Fireworks is still included in the Creative Suite, it was in CS3. Send me a PM and I'll see what I can do.

Link to comment
Share on other sites

@dencorso: Many thanks for always responding to my questions. I really appreciate it. You did it from day one, back about 4 1/2 years ago, and your input, in the many areas  in which we have communicated, has always added so much. I guess I'm just taking this opportunity to say, "Thanks for everything!"
-----------------------------------------------------------------------------------
@uid0: Thank you very much for your input! I did as you suggested, and it didn't work. For completeness, I'm showing what I did, just to make sure that I followed your suggestion correctly. Please tell me if I didn't. At a resolution of 72 pixels/inch, I made a Photoshop (PS) file with 2 layers: a gray 200x200px background layer and a red 200x51px rectangle on top. It's clear that for the red to be centered exactly on the gray, there needs to be (200-51)/2 =74.5px of gray above and below the red. Using the standard PS center command this is what I got:
 
original:

original.jpg
 
The red needs to be moved down 1/2px for it to be centered.

 

Then, I changed the resolution to 2x72=144 px/inch and moved the red down by 1 px. Then I changed the resolution back to 72 px per inch. I did that for 2 cases: #1 -- constraining proportions and #2 -- not constraining proportions. I got the same final result for both cases.
 

final:

final.jpg
 
What happened is that the red was stretched vertically by 1px, an undesired result, and was centered. But the interesting thing is that the top and bottom 1px of the red was not red, r,g,b=255,0,0, but became r,g,b=223,32,32.

 

Do you have any more ideas? If so, I'll happily try them. Thanks again for your input.
-----------------------------------------------------------------------------------

@Tripredacus: Thanks for your help. I think if/when I get the YouTube channel cover art done, I can save it as a JPEG and mail it to you. Because I know for a fact that Fireworks can open a JPEG. Then you can crop out the middle rectangle and easily reconstruct the background layer by filling in the area where the middle rectangle used to be with the dark background color. That will give you your 2 layers in Fireworks and you can then center the layers as required in the diagram in my first post. Then you can save it as a JPEG and mail it back to me. (Mailing is required, since if it's posted here, it will be resized smaller). I can then double check the centering with the PS ruler tool, which can register the 0.5.
 
Can you do the above scenario for the original JPEG above and post your result here? (It will post at the correct size, since it's small.) Thanks!
-----------------------------------------------------------------------------------
 
Thanks again, everyone, for your help.
 
Larry

 

Link to comment
Share on other sites

@larryb123456: You're welcome! :yes:

 

BTW, in theory a "pixel" is the smallest unity of collor a pic (generically, no matter whether it's a drawing or an image). In this sense, the pixel should be "atomic" (i.e.: allowing no further division whatsoever). So, it makes sense that, just as you reported, photoshop resorts to a color dithering trick (suposedly causing the impression of a semi-pixel, at least in some contexts), because pixels are indivisible. That said, I always like to remind people that, although in theory there no difference between theory and practice, in practice there often is at least some difference between them, so that there may actually be programs that can work on fractional pixel levels, regardless.

Link to comment
Share on other sites

To get "subpixel" resolution the image must be resampled. There is no way around it. Some software may perform it automatically, but it still does it (and it's a pain if it can't be controlled). You will lose some precision, which may not be noticeable on smooth photographs or anti-aliased shapes or type (which themselves already have gone through the process of oversampling, and have fractional pixel resolution), but definitely will blur out sharp transitions like the pixel art "51", assuming it was part of the actual picture you're working on.

However, you could resample only the layer that needs to be moved, and leave other layer(s) untouched. Copy it out into a new document, upscale it by a factor of 2, move it, for example, by adding 1px in the Canvas Size dialog. Downscale it to 50%, move it back into the original document.

You might want to experiment with different resampling algorithms to balance sharpness and ringing. I know some versions of Photoshop have different Bicubic modes. You might even save the isolated layer as a PNG file with transparency and make use of another software product to resize it, should its result be more pleasing to the eye.

If the movable layer was ever in vector format (such as if it was distorted text), you could go back to it's source file, and move the coordinates of it's shapes by the amount required, and repeat any raster editing it has to have.

Edited by j7n
Link to comment
Share on other sites

Do you even need to worry about the half pixels? Why not just make an image that is 2560x423? If it were me (and I'm not certain I care about people using Youtube on a TV), i'd use a gradient in my design to handle the space above and below the Max-Width sized banner.

 

Reference Guide:

https://support.google.com/youtube/answer/2972003?hl=en

Link to comment
Share on other sites

Thanks, everyone, for your input.

 

@Tripredacus:

I wanted to try to make my YouTube channel cover art as they directed, if possible, rather than take matters into my own hands and come up with all kinds of other approximations.

Those approximations, really deviations, were to be as a last resort.

I take it that you were unable to exactly center my 51px tall red rectangle in the 200px tall gray square, as you said you could do in your post describing a positioning feature of Fireworks.

Is that correct?

Or maybe you didn't want to take the time, about 3 minutes or so, to do as I asked when I said:

"Can you do the above scenario for the original JPEG above and post your result here? (It will post at the correct size, since it's small.) Thanks!",

which is at the bottom of that post, in between the two dashed horizontal lines.

If at all possible, I'd like for you to do what you can, the best you can, and post the result so that I can see the capabilities of Fireworks, in case I ever run into this situation again and might want to purchase Fireworks.

But, of course, as you well know, you don't have to do it just because I asked you.

 

@dencorso: Thanks, again my friend! You always have a knack for getting down to the real nitty gritty. If I make the central rectangle in my YouTube channel cover art 2560x422px, instead of 2560x423 as they recommend, and center it 509px above and below as you suggest, then the non-TV YouTube channel watchers will see a 1/2 pixel dark border at the top and bottom of the central region on their devices. Am I correct in my thinking here? A little dark border at the top and bottom might even improve the graphic. If I have no other alternative, I'll employ your suggestion. Thanks again!

Link to comment
Share on other sites

There are various problems here. Youtube decided to make a specific image size, to be designed in 3 sections using a total number of pixels that would seem to be the correct amount because it can be divided by 3. It would make sense at first, but it doesn't because you run into this problem. I've run into this before while doing my own designs. The end result is I would design something and it wouldn't be exactly centered, as I was using a "block model" in my design. This can be due to failure to count borders.

 

So while Fireworks allows me to physically type in half pixels, it also doesn't actually allow it. It is possible to "fake" it, but it would require you to have a feathered border (of some degree) on the block edge to make it appear it was centered. If you look at the sample image on the official Youtube guide, you see this in action as well.

 

The other problem is that whoever made the guide you want to use has made an error. They are presuming that the middle section (for non-TV devices) is supposed to be centered. Simple math tells you that the total height (1440) minus non-TV viewable height (423) gives you 1017... divide that in half and you get the 508.5. This would then seem to mean that the "always viewable" segment of the banner should have a Y of 508.5.

 

Here is where their error is revealed. If you download the actual template from Youtube (I tested the Fireworks PNG) and take a look where that center block starts, it is Y509.

 

So, that guide you are using is wrong. We can argue that Youtube is wrong because they should have done some better testing, however we should know that most people aren't picky about doing things properly. So you make do with what Youtube gives you... Although considering this type of image, I wouldn't use a block design that pushes directly to that border.

Link to comment
Share on other sites

@Tripredacus:

 

Re: Here is where their error is revealed. If you download the actual template from Youtube (I tested the Fireworks PNG) and take a look where that center block starts, it is Y509.

 

Thanks so much, Trip, for that very informative bit of writing and your detective work. I know that took considerable time, and this definitely closes the book on this question. I did download the actual template for reference, but didn't actually measure where the center block started, as you did. I just took YouTube's word for the 508.5px. Great thinking! I really appreciate your effort!

 

What I've mostly learned from this exercise are two things:

 

#1 -- As former U.S. President Reagan said:

 

TRUST BUT VERIFY

 

#2 -- NEVER TRUST   THE MAN

 

Just to be safe, I'm gonna go with #2 from here on out!

 

Thanks again, Trip!

 

Larry

Edited by larryb123456
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...