SAN FRANCISCO  A recent Supreme Court decision could alter what public transit riders here see in advertisements on city buses and trains and in transit shelters.

Images promoting guns, which are banned under an advertising policy of the San Francisco Metropolitan Transportation Agency, showed up recently on posters for a conference for the Second Amendment Foundation, a gun rights group based in Washington.

The group spent some $10,000 to have the posters, which feature a woman armed with a shotgun, hung at bus stops across the city. The poster’s red type reads, “A violent criminal is breaking through your front door. Can you afford to be unarmed?”

The group printed the posters after learning that movie posters for the film “The Other Guys,” starring Mark Wahlberg and Will Ferrell, had been altered to comply with the transit agency’s policy. At box offices, on billboards and in bus stops across the country, the movie’s poster depicted the actors with guns in each hand.