Giter VIP home page Giter VIP logo

Comments (4)

jcupitt avatar jcupitt commented on May 23, 2024

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.

from libvips.

 avatar commented on May 23, 2024
   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: [email protected]

At 2012-11-05 23:46:50,"John Cupitt" [email protected] 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.

from libvips.

jcupitt avatar jcupitt commented on May 23, 2024

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.

from libvips.

jcupitt avatar jcupitt commented on May 23, 2024

Closing this question, reopen if you need more.

from libvips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.