Jump to content

How to show a different image or percentage of the moon based upon the phrase?


MrTIMarshall

Recommended Posts

OK - I wasn't sure whether or not you wanted it.

 

The attached zip contains three files

 

moonpic100.gd2

- originally a 100 x 100  jpeg of the moon but cleaned up to ensure background is completely black. Saved as a gd2 for faster loading. This used as my base moon image.

 

moon.php

 - php image file which uses data returned from the moonPhase class and scales and blanks out the parts of the base image according to the phase and illumination values. This file takes an optional single query string parameter (date).

 

moonSample.php

- demo program to display lunar calendar for a month (?month=N in query string). Defaults to current month.

 

 

moon.zip

Link to comment
Share on other sites

I have not yet downloaded your .zip as I plan to do so when I am more refreshed tomorrow, however I am wondering if the image background needs to be black to show the phrase or can it be transparent to be used on a sky for example?

 

Thank you for uploading the files.

 

Best Regards,

Tim

Link to comment
Share on other sites

At the moment it needs to be on a dark background - there's still a dark fringe around the moon on a light background. All I have is Windows paint program, no photoshop, so image creation/manipulation not easy.

 

What I need if is a bright circular image of the moon (100pix diameter) inside a black 100 pix square.

 

Unwanted areas of the moon are then blacked out and black set to transparent colour.

Link to comment
Share on other sites

  • 9 months later...

As well as the three files in that zip it also requires moonphase .php which does the hard work calculating the data needed to draw the images. I didn't include it in the zip as the guy who started that topic already had it.

 

I've attached it here.

 

moon.php draws a single image (using moonpic100.gd2 as base image) based on the date passed in the url or today if no date passed.

moonsample.php calls moon.php to draw the moon for each day of the current month.

moonphase.php

Edited by Barand
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.