• Welcome to SC4 Devotion Forum Archives.

Creating "Square" Region Images

Started by dedgren, December 21, 2006, 09:34:38 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

dedgren

CREATING "SQUARE" REGION MAPS

This is the output we'll be creating in the following tutorial.




The first step is to open the region you wish to make a square map of in Region Census ("RC").  RC is a standalone utility created by sawtooth1178 that can be downloaded here from the LEX [linkie].

Once the region is open and displaying, select the "Save Image" menu choice from the "File" menu.



When the "Save file as" dialog box opens, navigate to where you want the file (i.e. a place where you can find it later on- you'll need it) and give the file a unique name.  The filetype default is to *.png- I don't change this as it produced great results as far as I'm concerned.



Next, open your graphics program.  In case you can't tell, I use an older, but beloved version of Paint Shop Pro ("PSP").  The steps I'll describe are specific to that program, but counterpart menu choices and tools should be in pretty much every full-featured graphics editing program out there.



Open the file you just created in RC...

...now, where'd I put the darned thing.

Note that it's quite large.  This gives you great detail, but might present a challenge if your computer is short on either processing speed or memory.



Once the file is open, you'll have output that looks like this- the standard "squashed rectangle" region view.  Notice that on my computer the image is displaying at 10% of full size.  This is one huge puppy of a region pic.

n.b.:  To all my Japanese friends out there- sorry for my occasional use of colloquialism.  Be assured that "large young dogs" have nothing to do with this process- PM me if I've created any confusion.



Navigate to the "Resize" menu selection of the "Image" menu and select it.  If you use PSP, you can press [ Shift ] and [ S ] to go straight there.



In the "Resize" dialog box that appears, first set the image resolution to the pixels per inc you use.  Everything on 3RR is always 150 ppi.



Next, uncheck the "Lock aspect ratio" checkbox.  This allows you to set height and width independent of eachother.



Set height and width of the image to be output at the same number of pixels.  I use a round number about 60% of the original image size- it gives me good results.  If you don't like what you get, you are free to experiment here- just remember that the height and width must be the same.



Click the dialog box's "OK" but to create the modified image.



Here's what you get...

...hey, it's a square tipped up on one side!  how'd you do that?

I dunno- computers...aren't they a wonderful thing?



For the next step, we'll return to the "Image" menubar choice and select "Rotate" from the menu that drops down.  This, in PSP, creates a popout submenu offering the choice to either select free rotation of the image or fixed 90 degree rotation either clockwise or counter-clockwise.  We'll select "Free Rotate."  If you use PSP, you can go straight to that submenu choice by pressing the [ Ctrl ] and [ R ] keys.



On the "Free Rotate" dialog box that appears, select "Left" (counter-clockwise) and then type the number 22.6 into the "Free" text field.  This means, in sum, that you'll be rotating your image 22.6 degrees counter-clockwise.  This number of degrees should be the same in any graphics program- I say this based on much trial and error on my part in arriving at it.

Click "OK" to do the rotation.



Your image now looks like this.  Square, and aligned with the perpendicular and horizontal planes.  But, we're not there yet.



On the left side of the PSP work area, we'll select the "Crop" tool from the "Tools" icon menu.



We then drag the selection box the tool creates around our image.  Note that you'll lose some of the mountains at the top and on the left side that protrude beyond where the edge of the image would be if the region was completely flat.  This is a loss, given the nature of RC's output, that is not avoidable.

Click to tooltip in the center of the image to complete the cropping.

What we now have is a region image that looks like this.  Perfectly rectangular...

...but we want perfectly square.



One last time, we'll return to the "Image" menu and select "Resize" ([ Shift ] and [ S ]).



A glimpse at the original dimensions noted at the top of the dialog box that appears confirms that all we have created so far is a rectangular image.  In the "Width" and Height" text fields, type in two identical figures that are the dimensions of the final region image you want to create in pixels.  I use the multiple of 1,024 that is closest but still under the smallest of the two original dimensions.  Why- well, that's complicated and beyond the scope of this tutorial to fully explain.  Suffice it for now to say that doing this allows for accurate scaling between the region grid and the image you are creating.  I'll revisit this topic in the future.

...uhh-oh- another promise.

Click "OK."  We're almost done.



The final step is to save your "square" region image in the output format you want to display it in.  If it is purely for your own use, save it in *.png or in your graphics program's native format.  If you are going to put it on the web, though, you'll want to use *.jpg format based on image size considerations.  That's what we'll do here.



Note that you should once again use a unique name for your image, and save it where you can find it...

...that's the voice of experience talking.



And you're done.  I can do one of these in about three minutes tops, so it's not that hard once you master the steps.

Here's a link to the "square" region image we just created [linkie].
D. Edgren

Please call me David...

Three Rivers Region- A collaborative development of the SC4 community
The 3RR Quick Finder [linkie]


I aten't dead.  —  R.I.P. Granny Weatherwax

Skype: davidredgren

metasmurf

Thanks you for this very usefull tutorial  &apls

beskhu3epnm

This is one of those things that I kind of figured was possible, but I was unsure of what the results would be. I was also unsure of the method...

You've explained this in a way that everyone will be able to understand. You've managed to revolutionize the way that maps will be displayed.

Excellent!



http://sc4devotion.com/forums/index.php?board=79.0
New Horizons Productions Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio dedgren ♦ Ennedi ♦ Heblem ♦ jplumbley ♦ moganite M4346 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine

TheTeaCat

What a superb piece of explaning you've done.
Clear, easy to understand language.

Another project for the future Thanks ::)

take a break now, I make a cuppa :thumbsup:


:satisfied:
Kettle's on. Milk? Sugars?    ps I don't like Earl Grey  $%Grinno$%
Reduce, Reuse, Recycle - If you're not part of the solution , you're part of the problem!
"Never knock on Death's door: Ring the bell and run away! Death really hates that!"
Tales at TeaTime      Now A proper NUT      TTC plays GRV II

emilin

*slaps forhead

Do you have any idea how much time I spent scewing the census shot in Photoshop to get it straight? And all I had to do was adjust the horisontals to the verticals... I feel very, very stupid right now.

Well, thank you for sharing this! It will save an incredible amount of time next time I have to map something.

BlackwaterEmil's inn
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren
♦ Emilin ♦ Ennedi ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦
papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine

sam

Great tutorial dedgren. I've messed about for ages in PSP trying to do this with various deform transformations and couldn't figure out how to get that result. I never thought to try a simple resize. Thanks for the tip, I'm off to make some maps  :thumbsup:

bat


Alfred.Jones

Thanks heaps for that tutorial Dedgren. It is very useful :thumbsup:

Sim City 4 Devotion

Masochist

Quote from: emilin on December 21, 2006, 05:04:38 PM
*slaps forhead

Do you have any idea how much time I spent scewing the census shot in Photoshop to get it straight? And all I had to do was adjust the horisontals to the verticals... I feel very, very stupid right now.

Well, thank you for sharing this! It will save an incredible amount of time next time I have to map something.

I'm with emilin...I spent hours trying to get the perspective right to get a trapezoid with as parallel sides as possible.  This will save so much more time, and will definately help in inspiring more people to try and create hand-drawn street maps and such.  Thank you so much!
(Under Construction)

mightygoose

if only i can get region census to render my monster of a region
NAM + CAM + RAM + SAM, that's how I roll....

meinhosen

Now that's a lot easier than the method I used...  I'm going to remember this next time I do an overhead region shot.

Bravo!  &apls  ;D
You're telling me I get to be home for more than 12 months?


szarkoz



It works! :thumbsup:
Thanks for that tutorial David!
If you can't read my nick, just call me Tom.

M4346

New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine

tkirch

Thanks again David, this is great.

I need so much help in doing things in graphic programs and you do such a great job explaining it to us noobs.

Traff

I've always wondered how to to this.
It applied very well in photoshop.
Thanks for the tutorial.
:)
____________________________________

Ralph


sawtooth

What a nice technique, I may have to do something about this in the future... :)

FrankU

Thanks David,
The trick is the resizing into a square. Didn't think of that!


delta9

#18
You can do this with city tiles as well.  The rescale and rotate parameters are the same for the furthest zoom as for a region image - double the height and rotate -22.6 degrees (I do 22.5 because it's 1/4 of 90).  The isometric perspective isn't constant throughout zooms, though, and I remember years ago reading a post somewhere that detailed the values.

Anyway, to get a "flat" image of the next-highest zoom: multiply your height by 1.75 rather than 2, and then rotate the same -22.5 degrees.  For example, if your image is 800x600, scale it to 800x1050, then rotate.

(Click to enlarge)


Of course, you could always divide the width rather than multiply the height, but there are two reasons you shouldn't do that:
1. Dividing by 1.75 gives you some noninteger numbers to round off (this isn't a problem for the highest zoom, since it's 2 instead)
2. The resampling looks better if you scale up and then scale back down after rotating, otherwise you get funny jaggies on straight lines like road markings

The image I posted was done by this method and then scaled back down to 50% of its height and width.  1280x800 -> 1280x1400 -> 640x700.

I may poke around and figure out the values for other zooms, but I don't think such images would turn out very well.  We shall see. :satisfied:

RippleJet

#19
Quote from: delta9 on December 17, 2009, 11:15:05 AM
The isometric perspective isn't constant throughout zooms, though, and I remember years ago reading a post somewhere that detailed the values.

:)

Quote from: RippleJet on April 02, 2009, 02:58:22 PM

  • 30° - Zoom 1
  • 35° - Zoom 2
  • 40° - Zoom 3
  • 45° - Zoom 4 & 5


  • 1/sin(30°) = 2.000
  • 1/sin(35°) = 1.743
  • 1/sin(40°) = 1.556
  • 1/sin(45°) = 1.414