Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (55)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (7132)

  • Padding thumbnail with color

    9 juin 2010, par Mikko Koppanen — Imagick, PHP stuff

    I know, it’s been a while since I last blogged. This is because a lot of things are happening in my personal life. I recently relocated to London from Finland and started a new job. Things are quite busy but I will try to post an example now and then. In the meanwhile I would like to hear about sites using Imagick, so if your project is not super secret please post an url and maybe a small explanation what you’re doing with Imagick on the site. This is purely for my personal interest.

    Anyway, to the point. Today’s example originates from a question asked by a user. How do I thumbnail the image inside given dimensions proportionally and fill the “blank” areas with a color ? Well, the answer is here :)

    The code is for Imagick 2.1.0 but adapting to older versions should not be hard.

    1. < ?php
    2. /* Define width and height of the thumbnail */
    3. $width = 100 ;
    4. $height = 100 ;
    5.  
    6. /* Instanciate and read the image in */
    7. $im = new Imagick( "test.png" ) ;
    8.  
    9. /* Fit the image into $width x $height box
    10.  The third parameter fits the image into a "bounding box" */
    11. $im->thumbnailImage( $width, $height, true ) ;
    12.  
    13. /* Create a canvas with the desired color */
    14. $canvas = new Imagick() ;
    15. $canvas->newImage( $width, $height, ’pink’, ’png’ ) ;
    16.  
    17. /* Get the image geometry */
    18. $geometry = $im->getImageGeometry() ;
    19.  
    20. /* The overlay x and y coordinates */
    21. $x = ( $width - $geometry[’width’] ) / 2 ;
    22. $y = ( $height - $geometry[’height’] ) / 2 ;
    23.  
    24. /* Composite on the canvas */
    25. $canvas->compositeImage( $im, imagick: :COMPOSITE_OVER, $x, $y ) ;
    26.  
    27. /* Output the image*/
    28. header( "Content-Type : image/png" ) ;
    29. echo $canvas ;
    30.  
    31.  ?>

    The source image :
    test.png

    The resulting image :
    testphp.png

  • Seam carving

    9 juin 2010, par Mikko Koppanen — Imagick, PHP stuff

    Today I was reading trough the ImageMagick ChangeLog and noticed an interesting entry. “Add support for liquid rescaling”. I rushed to check the MagickWand API docs and there it was : MagickLiquidRescaleImage ! After about ten minutes of hacking the Imagick support was done. Needless to say ; I was excited :)

    For those who don’t know what seam carving is check the demo here. More detailed information about the algorithm can be found here : “Seam Carving for Content-Aware Image Resizing” by Shai Avidan and Ariel Shamir

    To use this functionality you need to install at least ImageMagick 6.3.8-2 and liblqr. Remember to pass –with-lqr to ImageMagick configuration line. You can get liblqr here : http://liblqr.wikidot.com/. The Imagick side of the functionality should appear in the CVS today if everything goes as planned.

    Here is a really simple example just to illustrate the results of the operation. The parameters might be far from optimal (didn’t do much testing yet). The original dimensions of image are 500×375 and the resulting size is 500×200.

    Update : the functionality is pending until license issues are solved.

    1. < ?php
    2.  
    3. /* Create new object */
    4. $im = new Imagick( ’test.jpg’ ) ;
    5.  
    6. /* Scale down */
    7. $im->liquidRescaleImage( 500, 200, 3, 25 ) ;
    8.  
    9. /* Display */
    10. header( ’Content-Type : image/jpg’ ) ;
    11. echo $im ;
    12.  
    13.  ?>

    The original image by flickr/jennconspiracy

    result

    And the result :

    result

    Update. On kenrick’s request here is an image which is scaled down to 300×300

    result2

  • Revision 37293 : Retour en arrière (suppression de la noisette)

    15 avril 2010, par joseph@… — Log

    Retour en arrière (suppression de la noisette)