Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named vipsCC #35

Closed
ghost opened this issue Nov 5, 2012 · 4 comments
Closed

ImportError: No module named vipsCC #35

ghost opened this issue Nov 5, 2012 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 5, 2012

How to slove this problems?Thx

@jcupitt
Copy link
Member

jcupitt commented Nov 5, 2012

Hi, it could be caused by lots of things. On linux, check the setting of your PYTHONPATH variable and make sure that your vipsCC area is on there.

@ghost
Copy link
Author

ghost commented Nov 14, 2012

   Thank you very much for your reply! I come across some problems in my project:crop a 1000*1000 area from a 8000*8000 png image ,than sclae the 1000*1000 area to 8000* 8000 png image,I am not sure wheather the c++ code is right.it takes a lot time.Before using vips ,I had tied many ways,the imagick(PHP,takes 1s) to crop and java to scale(takes 4s) is the beast way I know.C++/Java/PHP code are pasted as accessories.Any good Suggestions?Finally,Forgive my poor English.

Zhongming Wu
Department of Electronics and Information Engineering
Huazhong University of Science and Technology
Wuhan, Hubei, P. R. China
ZIP: 430074

E-mail: zhongmingmao@163.com

At 2012-11-05 23:46:50,"John Cupitt" notifications@github.com wrote:

Hi, it could be caused by lots of things. On linux, check the setting of your PYTHONPATH variable and make sure that your vipsCC area is on there.

¡ª
Reply to this email directly or view it on GitHub.

@jcupitt
Copy link
Member

jcupitt commented Nov 15, 2012

Hi again,

In Ruby you could do this:

#!/usr/bin/ruby

require 'rubygems'
require 'vips'
include VIPS

# load the source image
# the :sequential arg means that we will only be accessing this image
# top-to-bottom -- this lets the reader avoid loading the entire image
im = Image.new(ARGV[0], :sequential => true)

# cut out 1000 x 1000 pixels at position 200 x 400
tile = im.extract_area(200, 400, 1000, 1000)

# scale up by a factor of 8 using a bicubic interpolator
big = tile.affinei_resize(:bicubic, 8)

# and save
big.write(ARGV[1])

On my (very old, very slow) desktop PC this runs like this:

$ time ./try83.rb ~/pics/5k.png x.png
real    0m21.433s
user    0m26.362s
sys 0m0.300s

Most of that time is spent in PNG load and save. PNG is a very, very slow file format. If I use tiff instead I see:

$ time ./try83.rb ~/pics/5k.tif x.tif
real    0m4.032s
user    0m6.056s
sys 0m0.588s

Which is more reasonable. This program runs in about 100mb of memory here.

If I try ImageMagick I see:

$ time convert ~/pics/5k.png[1000x1000+200+400] -interpolate bicubic -resize 800% x.png
real    0m36.742s
user    0m37.738s
sys 0m0.864s

So vips is faster than IM at least. The IM program needs about 500mb of memory.

@jcupitt
Copy link
Member

jcupitt commented Dec 6, 2012

Closing this question, reopen if you need more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant