LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-26-2012, 05:48 AM   #1
cin_
Member
 
Registered: Dec 2010
Posts: 264

Rep: Reputation: 23
CLI : Is There A Script To Skew Image With A Curve


Looking for a script that will skew an image for me through the command line.

The skew needs be a curve; stead the angle skews offered by imagemagick or lunapic.


I want it to look like it is placed up in a celestial sphere.
Basically able to fit inside of these boxes.

Thanks.


... fred's scripts: skew ... http://www.fmwconcepts.com/imagemagick/skew/index.php
... lunapic.com ... http://www.lunapic.com/editor/?action=skew
... wiki: Celestial Sphere ... http://en.wikipedia.org/wiki/Celestial_sphere
... wireframe of inside sphere ... http://www.dreamstime.com/royalty-fr...-image11717706

Last edited by cin_; 08-26-2012 at 05:59 AM. Reason: gramm`err
 
Old 08-26-2012, 06:28 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You might need to use something like Povray.
 
1 members found this post helpful.
Old 08-26-2012, 06:41 AM   #3
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
Skew With A Curve

Thanks for the suggestion. I am looking at the software now and it seems like a 3D image renderer, but do you know if it can or how to manipulate 2D images to appear to be resting on the inside of an invisible sphere?

Looks like it can, using hollow spheres.


Installing now, I will update if it works.


... http://www.povray.org/documentation/view/3.6.0/155/

Last edited by cin_; 08-26-2012 at 09:26 PM. Reason: gramm`err
 
Old 08-26-2012, 03:56 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I've used blender rather than povray. I think you want to use the pictures as textures.Getting the lighting and environment right may be the hardest part.
 
Old 08-26-2012, 08:04 PM   #5
cin_
Member
 
Registered: Dec 2010
Posts: 264

Original Poster
Rep: Reputation: 23
Figured

Now that I have had some time to play around with it, I have POVRay acting as I had hoped.
Here is the setup:

The .pov and .ini files are sort of hacked up from multiple sources.
For the layout and bulk of the .ini and .pov files :: http://www.mpa-garching.mpg.de/~msel...ay/povray.html
For the sphere texture :: http://www.f-lohmueller.de/pov_tut/tex/tex_876e.htm

Also the texture is applied to the outside of the sphere so for the image to be viewed from inside out and have the proper view you will have to transform the image as a horizontal mirror image.

Code:
# convert -flop InIMG.jpg OutIMG.jpg
MYPOVFILE.ini
Code:
Input_File_Name=MYPOVFILE.pov                         ; input file name(s)
;Library_Path=

+W400 +H400                                           ; resolution: W(idth) times H(ight)
Display=on

Quality=9                                             ; 0 .. 11 (best), default: 9
Bounding=on
;Bounding_Threshold=25
Light_Buffer=on                                       ; (requires bounding on)
Vista_Buffer=on                                       ; (requires bounding on)
Antialias=on
Sampling_Method=1                                     ; 1 or 2 (both adaptive, 2 recursive)
Antialias_Threshold=0.1                               ;
Antialias_Depth=6                                     ; 1 .. 9 (best), default: 6
Jitter=on                                             ;
Jitter_Amount=1.0                                     ; 0.0 .. 1.0 (best)
Field_Render=off

Output_to_File=on
Output_File_Type=N                                    ; N for PNG
Output_Alpha=off
Bits_per_Color=16                                     ; 8 .. 16 for PNG
;Output_File_Name=

;--------------------------------------------------------------------------------------------------

;Initial_Frame=0
;Final_Frame=36
;Initial_Clock=0
;Final_Clock=1
MYPOVFILE.pov
Code:
global_settings
{  ambient_light <1,1,1>
   assumed_gamma 1
}
camera
{ 
 location <-.3,0,0>  
//x,y,z
//x=.1+ rotate90cw move down; x=-.1- rotate90ccw move down
//y=.1+ move down; y=-.1- move down flip
//z=.1+ zoom ; z=-.1- zoomout
   up z
   right x                                   
   look_at <170,0,270>
//x move camera left to right
//y move camera up and down
//z  0,0,270 straight on view
}
light_source
{  <0,0,0>
   color rgb <1,1,1>
   media_interaction on
   media_attenuation on
   shadowless
}

//-------------------------------------------------------------------------------------------------
sphere{ <0,0,0>, 0.5
        texture{ pigment{ color rgb<1, 1,1>}
                 finish { diffuse 0.9 phong 0.1}
               } // end of texture 1

        texture{ pigment{
                 image_map{ gif "cmailoFLOP.gif"
                            map_type 0
                            once
                          }
                 translate<-0.5,-0.5,0>
                 scale<1,1,1>*0.35
                 } // end pigment
               } // end of texture 2
  } // end of sphere  ------------------


//-------------------------------------------------------------------------------------------------
Simply move around the camera's location and look_at attributes and you can achieve any view angle of an image superimposed on a concave curved surface.
Keep the values small, ie .1, .3, else you may go outside the sphere.

Code:
# ls

# povray MYPOVFILE.ini
# ls
MYPOVFILE.png
To make the white background transparent...
Code:
# convert -transparent white MYPOVFILE.png MYTRANSPARFILE.png
Endless thanks to jschiwal for suggesting POVRay!

Last edited by cin_; 08-26-2012 at 09:51 PM. Reason: gramm`err
 
  


Reply

Tags
cli


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] image viewer in X with cli control? mrclisdue Slackware 11 07-22-2012 09:02 AM
How to resize image in CLI with keeping palette and type as original ts4053 Linux - Software 1 01-05-2010 08:35 AM
LXer: Show Image Properties (Meta Data) from CLI Linux LXer Syndicated Linux News 0 12-04-2008 11:20 PM
LXer: CLI Magic: Feh for image viewing LXer Syndicated Linux News 0 07-31-2006 03:54 PM
Image viewers for the CLI shotokan Linux - Software 5 01-07-2006 05:30 AM


All times are GMT -5. The time now is 10:36 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration