overlap a picture with a smaller picture

Discussion in 'HTML & Website Design' started by J.P, Apr 11, 2006.

  1. #1
    I've seen this done on a site and interested in how it is done :)

    You are displaying .jpg images of a property for sale.

    Someone buys this property.

    You need to add "SOLD" across the pictures without editing the picture it's self

    I believe that the "SOLD" is just another picture that is over lapping the first but wondering how this is done if anyone knows?

    JP
     
    J.P, Apr 11, 2006 IP
  2. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #2
    you can do it with php and GD
     
    Shoemoney, Apr 11, 2006 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    Could also do it with a "Sold" image having a transparent background and just stacking the two images.
     
    digitalpoint, Apr 11, 2006 IP
  4. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #4
    wouldnt that be very browser dependant though?
     
    Shoemoney, Apr 11, 2006 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    I don't think so... could use absolute positioning to throw the "Sold" image on top of the other... or you could have the bottom picture be a background image of some HTML element or something.
     
    digitalpoint, Apr 11, 2006 IP
  6. J.P

    J.P Notable Member

    Messages:
    767
    Likes Received:
    42
    Best Answers:
    3
    Trophy Points:
    205
    #6
    having a look as never though of background images;

    I guess you could have something like;

    <td background="/images/housepiccy.jpg"><img src="/images/sold.jpg"></td>

    long as the "sold.jpg" is smaller than the housepiccy is will display on top.
     
    J.P, Apr 11, 2006 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    The simplest way to find out is to look at the source. Do you have a link to an example page?

    cheers,

    gary
     
    kk5st, Apr 12, 2006 IP
  8. dfsweb

    dfsweb Active Member

    Messages:
    1,587
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    88
    #8
    You can do this using layers as well. I wouldn't recommend it to be honest as if the browser isn't compatible, the layers spread out .... i.e the house and sold image would appear separate. It is ideal to do this in a photo package imo (using layers) and then combining them to form one image so the browser is only dealing with a single image and won't get muddled up.
     
    dfsweb, Apr 12, 2006 IP
  9. bizmart

    bizmart Active Member

    Messages:
    436
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #9
    More or less correct but, much like Shawn said, you would be better off making your ‘sold’ image a transparent gif rather than a jpg. This way the sold image could even be the same size as the underlying photo, but as everything except the word ‘sold’ would be transparent, the background image would show through. It should also work on all browsers if setup correctly.

    I used to use this method to good effect in a slightly different way with a product site I had when I didn’t want visitors/competitors to easily copy my images. I would make my product photos the background of a table cell and then place a completely transparent gif on top, in the cell its self. I lost count of the number of times customers contacted me to say they had tried to right click and save photos from my site only to end up with blank images. Of course, it didn’t stop the most determined of people from copying the images but it did manage to fool the majority of them. I also used to add to the confusion by putting something like “Inages on this site tracked and protected by PixProtector Software” in the footer – no search could ever find that particular software since it didn’t really exist but it would put you in a good position to sell the secret to anyone that contacted you to ask how it was done (only a few could figure it out by looking at the HTML). I used this method quite some time ago, so I guess there are far simpler solutions available with scripts these days
     
    bizmart, Apr 12, 2006 IP