World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 03-09-2008, 06:03 PM   #1
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default Dstile & jpeg

I know this issue has been discussed several times, but I still can't find solution for it. Dstile generate jpeg and png, png is too large so I want to use jpeg. but dstile create jpeg with black background for areas which is out of the original extent, which makes map looks so ugly. Have any one found solution for this. Or maybe I am doing this in a wrong way?!!
ayman is offline   Reply With Quote
Old 03-09-2008, 06:22 PM   #2
remleduff
Senior Member
 
Join Date: Jun 2007
Posts: 218
remleduff is on a distinguished road
Default

Well, jpgs don't support transparency.

Can you use different compression parameters with the png files to make them smaller?
remleduff is offline   Reply With Quote
Old 03-10-2008, 05:46 AM   #3
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default

Right jpeg dosn't support transparency, and dstile has no parameters to make png smaller
ayman is offline   Reply With Quote
Old 03-11-2008, 12:35 AM   #4
what_nick
Worldwind Developer
 
Join Date: Jan 2006
Location: Hobart, Australia
Posts: 754
what_nick is an unknown quantity at this point
Default

You can specify black as transparent for JPEG's. The PNG tiling was meant for those who wanted full quality tiles at a smaller size than DDS, so quality is lossless. I can add PNG compression options to the long list already there.

Cheers,

what_nick.
__________________
Coding This and That in World Wind and helping new people out, as long as they don't pester too much.
Currently blogging at: http://whatnicklife.blogspot.com
Working at:
Aerometrex - http://aerometrex.com.au/blog/
Impact so far:


what_nick is offline   Reply With Quote
Old 03-11-2008, 06:07 AM   #5
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default

Thanks, but how I can specify black as transparent for JPEG's. As I know jpeg doesn't support transperancy
ayman is offline   Reply With Quote
Old 03-11-2008, 07:57 PM   #6
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default

Very strange, There is two options, either I am the only one who is facing this problem and no one wants to help, or no one is trying to add his own data using dstile. I am trying to find the solution already 2 weeks no success
ayman is offline   Reply With Quote
Old 03-12-2008, 12:20 AM   #7
Chade
Senior Member
 
Join Date: Apr 2006
Posts: 407
Chade is an unknown quantity at this point
Default

Ah. Java. Thought it was .NET. This has been done before. Anyway, search for 'imagemagic' on the forums here, you should come up with the thread on this from a couple of weeks ago.
__________________
Machine. Unexpectedly, I’d invented a time
- Alan Moore
Chade is offline   Reply With Quote
Old 03-12-2008, 12:27 AM   #8
remleduff
Senior Member
 
Join Date: Jun 2007
Posts: 218
remleduff is on a distinguished road
Default

I'm pretty sure that with the current WWJ, your options are either to use png or dds or implement your own extension to TiledImageLayer that does a little manipulating of the image data before it passes the BufferedImage off to TextureIO.

I don't think the second sounds too difficult actually, but it's not implemented and talk is cheap.

Or perhaps file a bug report and wait and see if the next WWJ release addresses the issue. If WW.net assumes that RGB (0,0,0) should be transparent, it seems that WWJ probably should too.
remleduff is offline   Reply With Quote
Old 03-12-2008, 06:49 AM   #9
ayman
Junior Member (Java Lover)
 
Join Date: Feb 2008
Posts: 189
ayman is on a distinguished road
Default

Well, I did some work around, where I am using png with transparency in boundaries and jpeg for all other images.
it works
public java.net.URL getURL(gov.nasa.worldwind.util.Tile tile) throws MalformedURLException {
Sector sec = tile.getSector();
boolean equal = true;
String thePath = "";//Path to images
java.net.URL urlx = null;
if (sec.getMinLatitude().degrees< originalSecror.getMinLatitude().degrees ||
sec.getMinLongitude().degrees< originalSecror.mySector.getMinLongitude( ).degrees ||
sec.getMaxLongitude().degrees> originalSecror.mySector.getMaxLongitude( ).degrees ||
sec.getMaxLatitude().degrees> originalSecror.mySector.getMaxLatitude() .degrees)
{
equal = false;
tile.getLevel().setFormatSuffix(".png");
urlx = new java.net.URL(thePath + ".png");
}else {
tile.getLevel().setFormatSuffix(".jpg")
urlx = new java.net.URL(thePath + ".jpg" +);
}
return urlx;
}

Last edited by ayman; 03-12-2008 at 06:54 AM.
ayman is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DSTile Error: permission denied arun.kumar Image Serving & GIS 6 11-17-2011 05:08 AM
More problems using dstile Holywhippet Image Serving & GIS 15 04-24-2008 02:31 AM
Layer Zero for DsTile glu29 Technical Support 0 12-07-2007 05:04 PM
Dstile win port what_nick WorldWind General 87 09-15-2007 03:53 AM
DSTILE help Efrain Image Serving & GIS 14 07-12-2007 04:46 PM


All times are GMT +1. The time now is 11:04 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.