/    Sign up×
Community /Pin to ProfileBookmark

What features would you like included in an image manipulation class?

[B]What features would you like to see included in an image manipulation class?[/B]

[list]

  • [*]

    resizing


  • [*]

    cropping


  • [*]

    text and image based watermarks


  • [*]

    grayscale


  • [*]

    unsharpmask


  • [*]

    maintained transparency and alpha channel


  • [/list]

    What else would you like to see included?

    to post a comment
    PHP

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @NogDogJun 07.2006 — [list]
  • [*]rotate 90 degrees clockwise

  • [*]rotate 90 degrees counterclockwise

  • [*]flip vertically

  • [*]flip horizontally

  • [/list]

    (I'm not sure if the GD library supports these, but they'd be useful for things like custom borders and corners.)
    Copy linkTweet thisAlerts:
    @bokehauthorJun 07.2006 — [list]
  • [*]rotate 90 degrees clockwise

  • [*]rotate 90 degrees counterclockwise

  • [*]flip vertically

  • [*]flip horizontally

  • [/list]

    (I'm not sure if the GD library supports these, but they'd be useful for things like custom borders and corners.)[/QUOTE]
    I added those tonight as well rotate 180 degrees. I thought it was going to be difficult but once I did the first one the other four only took a couple of minute each. [code=php]function Rotate90()
    {
    $w = $this->source_width;
    $h = $this->source_height;
    $slate = $this->slate($h, $w);
    for ($x = 0; $x < $w; $x++)

    {
    for ($y = 0; $y < $h; $y++)

    {
    extract(imagecolorsforindex($this->source, ImageColorAt($this->source,$x,$y)));
    ImageSetPixel($slate, (($h - 1) - $y), $x, ImageColorAllocatealpha($slate, $red, $green, $blue, $alpha));
    }
    }
    imagedestroy($this->source);
    $this->source = $slate;
    $this->source_width = $h;
    $this->source_height = $w;
    } [/code]
    I don't know if that is clear. I just created a second image and copied the first to the second one pixel at a time but to different coordinates, then destroyed the first one and substituted it with the second.
    ×

    Success!

    Help @bokeh spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.10,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...