educational

Photoshop Slices for Newbies

If you’re like Scotty then you build your entire design in Photoshop first, and worry about the HTML and other stuff later. For those unfamiliar with the techniques involved, or those wanting some inside tips, here’s our latest Photoshop tutorial:

Ok, so now you have an entire design ready to be turned into HTML. Starting with a flat image (just one big image), it’s time to cut it up into multiple images, or slices. This way we can add some user activity – such as mouse-over effects, creating links, and animation, as well as many other amazing features. But anyway, when you slice an image you’re actually taking that image and then creating additional images: think of it as a finished puzzle and each individual image slice as a piece.

The size and dimension of each slice, as well as the number of slices is all up to you. The main objects that I like to keep as separate slices are the title and each individual navigation item (also known as a link). It’s also a good idea to slice up high density areas of your image (where a lot of color and activity goes on). Now don’t get too carried away with over slicing (such as creating 500 individual slices all 1 pixel in width), because too much can make things even more confusing, however there is no limit (at least I haven’t hit a limit) to how many slices you can have. So now that you know a little bit about slices, it’s time to actually slice it up!

While in Photoshop (only Photoshop 7: if you’re using an earlier version you more then likely have to go to ImageReady to slice) open up your design and press K to select the ‘slice tool’. Click and drag out a box over your image to create a blue box with a number in the corner (this number is the slice number), this box is actually your second slice since the original image as one piece would be considered one slice. A handy shortcut to know while using slices is pressing CTRL+H key, this will Hide and then Show your slices each time it's pressed.

Once you have created all your slices, select the other slice tool (buried under the original). This is called the ‘Slice Select Tool’. Use this to select and modify each slice (size, attributes), you can also double click any slice to set linking URLs & other miscellaneous details (I usually save off on setting the URLs and such for the next step, mostly because I prefer the quicker interface ImageReady provides, rather then the annoying popup Photoshop uses).

Now it’s time to take our sliced up image and put it in HTML format; and rather than hand-coding this step, we will use ImageReady’s exportation method. First press the ‘Jump to ImageReady’ button (located at the bottom of the toolbar). Although you can export from within Photoshop, I would like you to get a feel for ImageReady so you’re ready to use it for my future articles.

In ImageReady you can perform additional functions such as mouseovers and animations (my next article will get into this). But for now, simply click File > Save For Web, select an optimization (graphic quality levels, reflects file size), then save as layout.html (or whatever you want) in its own folder (make a new one or use one of those empty ‘New Folders’ you have laying around on your desktop).

This exportation will automatically create an images directory (you can define the name of the directory it saves images to within ImageReady’s preferences). Export each individual slice as a separate image into the images directory, as well as generate the HTML table, or even a DHTML DIV layout (once again depending on your preferences).

Take it a Step Further…
Want to know how to put plain text on top of a slice? After exportation, open up the HTML code that Photoshop/ImageReady generated. Find the slice you wish to write plain text over. Now set the table’s <TD> background=" to the image SRC of our selected slice (example, layout_12.gif), also set width = to the same as the original image width and height= to the original image height (both displayed right in front of you within the <IMG> tag of slice 12). It’s also a good idea to set ‘valign=top’. Set this while still in the <TD>, and it will vertically align your text at the top. You can also set valign to bottom (for bottom vertical alignment), or nothing for center (or middle) vertical alignment. Then just simply input your text <TD> .*. > between here! <TD>, and delete the remaining <IMG> tag (with the original slice image name).

Now your flat HTML text will appear on top of your slice image. All we really did was take the slice image and rather then being an image convert it to the background image of the current table cell (<TD>).

One thing you need to keep in mind is that this is very basic, and if you overflow your area with more text than can fit; the background for this individual table cell will stretch, as well as all the other table cells on the same row… Either rework your text to fit within your boundaries, or stick around for my upcoming article which will go more into dealing with stretching backgrounds and mouseovers.

Slices have become a necessary method of designing Web sites, and to do it manually takes a great deal of time and precision, so instead use Photoshop or ImageReady to perform your slicing and exportation, and get to spend more time on more productive areas.

That about wraps it up! There is a lot of activity and jumping around taking place within this article (between Photoshop, ImageReady, and then into actual code), take your time, and explore your options; you may need to reference this article in the future, so now would be a good time to bookmark it! Any questions feel free to contact me at me@scotty.cc. Enjoy the Slices! Scotty

Copyright © 2024 Adnet Media. All Rights Reserved. XBIZ is a trademark of Adnet Media.
Reproduction in whole or in part in any form or medium without express written permission is prohibited.

More Articles

opinion

Strategic Upscaling of Non-4K Content

If content is king in adult, then technical quality is the throne upon which it sits. Technical quality drives customer acquisition and new sales, while cementing retention and long-term loyalty.

Brad Mitchell ·
profile

'Traffic Captain' Andy Wullmer Braves the High Seas as Spirited Exec

Wullmer networked and hobnobbed, gaining expertise in everything from ecommerce to SEO and traffic, making connections and over time rising through the ranks of several companies to become CEO of the mobile business arm of TrafficPartner.

Alejandro Freixes ·
opinion

To Cloud or Not to Cloud, That Is the Question

Let’s be honest. It just sounds way cooler to say your business is “in the cloud,” right? Buzzwords make everything sound chic and relevant. In fact, someone uninformed might even assume that any hosting that is not in the cloud is inferior. So what’s the truth?

Brad Mitchell ·
opinion

Upcoming Visa Price Changes to Registration, Transaction Fees

Visa is updating its fee structure. Effective April 1, both the card brand’s initial nonrefundable application fee and annual renewal fee will increase from $500 to $950. Visa is also introducing a fee of 10 cents for each settled transaction, and 10 basis points — 0.1% — on the payment volume of certain merchant accounts.

Jonathan Corona ·
opinion

Unpacking the New Digital Services Act

Do you hear the word “regulation” and get nervous? When it comes to the EU’s Digital Services Act (DSA), you shouldn’t worry. If you’re complying with the most up-to-date card brand regulations, you can breathe a sigh of relief.

Cathy Beardsley ·
opinion

The Perils of Relying on ChatGPT for Legal Advice

It surprised me how many people admitted that they had used ChatGPT or similar services either to draft legal documents or to provide legal advice. “Surprised” is probably an understatement of my reaction to learning about this, as “horrified” more accurately describes my emotional response.

Corey D. Silverstein ·
profile

WIA Profile: Holly Randall

If you’re one of the many regular listeners to Holly Randall’s celebrated podcast, you are already familiar with her charming intro spiel: “Hi, I’m Holly Randall and welcome to my podcast, ‘Holly Randall Unfiltered.’ This is the show about sex, the adult industry and the people in it.

Women In Adult ·
trends

What's Hot Now: Leading Content Players on Trending Genres, Monetization Strategies

The juggernaut creator economy hurtles along, fueled by ever-ascendant demand for personality-based authenticity and intimacy — yet any reports of the demise of the traditional paysite are greatly exaggerated.

Alejandro Freixes ·
opinion

An Ethical Approach to Global Tech Staffing

One thing my 24-year career as a technologist working to support the online adult entertainment industry has taught me about is the power of global staffing. Without a doubt, I have achieved significantly more business success as a direct result of hiring abroad.

Brad Mitchell ·
opinion

Finding the Right Payment Partner

Whenever I am talking with businesses that are just getting started, one particular question comes up a lot: “How do I get a merchant account?” It’s a simple question, but it has a complicated answer.

Jonathan Corona ·
Show More