Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat
Welcome, Guest. Please login or register.
Did you miss your activation email?

June 19, 2021, 06:52:08 AM

Login with username, password and session length

Author Topic: Creating "Square" Region Images  (Read 26635 times)

0 Members and 1 Guest are viewing this topic.

Offline dedgren

Creating "Square" Region Images
« on: December 21, 2006, 11:34:38 AM »
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].
« Last Edit: April 12, 2009, 02:40:28 PM by dedgren »
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

Offline metasmurf

  • Forums Senator
  • *
  • Posts: 744
  • Total likes: 0
  • Reputation: 3
  • Smurfin teh sc4
Re: Creating "Square" Region Images
« Reply #1 on: December 21, 2006, 12:03:53 PM »
Thanks you for this very usefull tutorial  &apls

Offline beskhu3epnm

  • NHP Team
  • Forums Governor
  • *
  • Posts: 348
  • Total likes: 1
  • Reputation: 11
  • New Horizons Productions September 6, 2006
Re: Creating "Square" Region Images
« Reply #2 on: December 21, 2006, 12:05:12 PM »
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

Offline TheTeaCat

Re: Creating "Square" Region Images
« Reply #3 on: December 21, 2006, 01:02:28 PM »
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

Offline emilin

  • NHP Team
  • Forums Senator
  • *
  • Posts: 879
  • Total likes: 4
  • Reputation: 15
  • CL: Need a Port ? ()Portmaster()
Re: Creating "Square" Region Images
« Reply #4 on: December 21, 2006, 07: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.

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

Offline sam

Re: Creating "Square" Region Images
« Reply #5 on: December 21, 2006, 10:00:04 PM »
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:

Offline bat

  • Forums Legend
  • *
  • Posts: 8999
  • Total likes: 2
  • Reputation: 20
    • Capporth City - my first and only MD
  • CL: bester deutscher Verfechter
Re: Creating "Square" Region Images
« Reply #6 on: December 22, 2006, 03:18:27 AM »
Very useful tutorial!! &apls :thumbsup: :thumbsup: :thumbsup:

Offline Alfred.Jones

  • Forums Parliamentarian
  • *
  • Posts: 1227
  • Total likes: 0
  • Reputation: 7
    • Simcities
  • CL: SC4D Local
Re: Creating "Square" Region Images
« Reply #7 on: December 22, 2006, 03:26:18 AM »
Thanks heaps for that tutorial Dedgren. It is very useful :thumbsup:

Sim City 4 Devotion

Offline Masochist

  • Forums Parliamentarian
  • *
  • Posts: 1101
  • Total likes: 24
  • Reputation: 16
  • You found one of my old posts! Hope you enjoy it!
    • My SC4 Blog
  • CL: I want more SC4D    :D  :latigo:
Re: Creating "Square" Region Images
« Reply #8 on: January 14, 2007, 02:16:38 AM »
*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)

Offline mightygoose

  • 3RR Team
  • Forums Parliamentarian
  • *
  • Posts: 1885
  • Total likes: 7
  • Reputation: 12
  • duck duck....
Re: Creating "Square" Region Images
« Reply #9 on: January 17, 2007, 01:46:52 PM »
if only i can get region census to render my monster of a region
NAM + CAM + RAM + SAM, that's how I roll....

Offline meinhosen

  • Forums Governor
  • *
  • Posts: 383
  • Total likes: 0
  • Reputation: 4
  • Call me Sarge
Re: Creating "Square" Region Images
« Reply #10 on: January 21, 2007, 01:46:00 PM »
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?


Offline szarkoz

Re: Creating "Square" Region Images
« Reply #11 on: January 26, 2007, 02:11:51 PM »


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

Offline M4346

  • NHP Team
  • Forums Parliamentarian
  • *
  • Posts: 1744
  • Total likes: 33
  • Reputation: 17
  • M, Super M
    • M's FB
Re: Creating "Square" Region Images
« Reply #12 on: January 26, 2007, 05:20:20 PM »
Great tutorial! Thanks!  :thumbsup: :thumbsup: :thumbsup:
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine

Offline tkirch

Re: Creating "Square" Region Images
« Reply #13 on: February 02, 2007, 09:10:39 AM »
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.

Offline Traff

Re: Creating "Square" Region Images
« Reply #14 on: February 07, 2007, 08:09:10 PM »
I've always wondered how to to this.
It applied very well in photoshop.
Thanks for the tutorial.
:)
____________________________________

Offline Ralph

Re: Creating "Square" Region Images
« Reply #15 on: March 12, 2007, 01:40:27 PM »
 &apls  Very good this tuto !

Offline sawtooth

Re: Creating "Square" Region Images
« Reply #16 on: April 06, 2007, 10:09:47 AM »
What a nice technique, I may have to do something about this in the future... :)

Offline FrankU

  • It's Frank, the U is just for the suspense
  • BeNeLux Team
  • Forums Guru
  • *
  • Posts: 3348
  • Total likes: 228
  • Reputation: 14
  • Dutch Housing Project
  • CL:
    U Grow It
Re: Creating "Square" Region Images
« Reply #17 on: October 29, 2007, 09:43:59 AM »
Thanks David,
The trick is the resizing into a square. Didn't think of that!


Offline delta9

Re: Creating "Square" Region Images
« Reply #18 on: December 17, 2009, 01:15:05 PM »
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:
« Last Edit: December 17, 2009, 01:18:18 PM by delta9 »

Offline RippleJet

Re: Creating "Square" Region Images
« Reply #19 on: December 18, 2009, 12:59:31 AM »
The isometric perspective isn't constant throughout zooms, though, and I remember years ago reading a post somewhere that detailed the values.

:)

  • 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
« Last Edit: December 18, 2009, 01:02:13 AM by RippleJet »