|
From: info <in...@an...> - 2006-07-25 08:33:24
|
Hello, How is possible not to lose bitmap resolution during processing? For example if I load a 300 dpi image after processing and saving I obtain a 70 dpi image. Regards Antonio -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 24/07/2006 |
|
From: Maxim S. <mcs...@ya...> - 2006-07-25 20:28:44
|
Can you explain it more? What do you use to load and save images? > Hello, > > How is possible not to lose bitmap resolution during processing? > For example if I load a 300 dpi image after processing and saving I obtain a > 70 dpi image. > > Regards > Antonio > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 24/07/2006 > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> _______________________________________________ > Vector-agg-general mailing list > Vec...@li... > https://lists.sourceforge.net/lists/listinfo/vector-agg-general > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Analist <in...@an...> - 2006-07-26 08:14:05
|
Hi McSeem,
1) I load an image, example 300 dpi with this code:
BOOL CAggBuffer::LoadBmp(CString csFile)
{
ASSERT(!csFile.IsEmpty());
agg::pixel_map pmap_tmp;
if(!pmap_tmp.load_from_bmp(csFile)) return false;
m_dImageWidht = pmap_tmp.width();
m_dImageHeight = pmap_tmp.height();
agg::rendering_buffer rbuf_tmp;
rbuf_tmp.attach(pmap_tmp.buf(),
pmap_tmp.width(),
pmap_tmp.height(),
m_flip_y ?
pmap_tmp.stride() :
-pmap_tmp.stride());
m_pmap_img.create(pmap_tmp.width(),
pmap_tmp.height(),
agg::org_e(m_bpp),
0);
m_rbuf_window.attach(m_pmap_img.buf(),
m_pmap_img.width(),
m_pmap_img.height(),
m_flip_y ?
m_pmap_img.stride() :
-m_pmap_img.stride());
FitToImageSize(m_dImageWidht,m_dImageHeight);
switch(m_format)
{
case agg::pix_format_gray8:
switch(pmap_tmp.bpp())
{
//case 16: agg::color_conv(&m_rbuf_window, &rbuf_tmp,
color_conv_rgb555_to_gray8()); break;
case 24: agg::color_conv(&m_rbuf_window, &rbuf_tmp,
agg::color_conv_bgr24_to_gray8()); break;
//case 32: agg::color_conv(&m_rbuf_window, &rbuf_tmp,
color_conv_bgra32_to_gray8()); break;
}
break;
case agg::pix_format_gray16:
.................
.................
3) I process it with:
typedef agg::span_interpolator_persp_exact<> interpolator_type;
typedef agg::span_subdiv_adaptor<interpolator_type> subdiv_adaptor_type;
typedef agg::image_accessor_clone<pixfmt> source_type;
interpolator_type interpolator(m_quad.polygon(), g_x1, g_y1, g_x2, g_y2);
subdiv_adaptor_type subdiv_adaptor(interpolator);
if(interpolator.is_valid() /*&& 1==2*/)
{
typedef image_resample_type<source_type, subdiv_adaptor_type>
span_gen_type;
span_gen_type sg(source, subdiv_adaptor, filter);
sg.blur(1);
agg::render_scanlines_aa(g_rasterizer, g_scanline, m_ElabBuff.m_rb, sa,
sg);
}
m_bTransform = FALSE;
3) I save the buffer with : m_pmap_window.save_as_bmp
4) The resulting image is 72 dpi
Antonio
"Maxim Shemanarev" <mcs...@ya...> ha scritto nel messaggio
news:200...@we......
> Can you explain it more? What do you use to load and save images?
>
>> Hello,
>>
>> How is possible not to lose bitmap resolution during processing?
>> For example if I load a 300 dpi image after processing and saving I
>> obtain a
>> 70 dpi image.
>>
>> Regards
>> Antonio
>>
|
|
From: Maxim S. <mcs...@ya...> - 2006-07-26 16:53:20
|
> FitToImageSize(m_dImageWidht,m_dImageHeight); What does it do? > 3) I process it with: [. . .] It also can change the size. > 3) I save the buffer with : m_pmap_window.save_as_bmp > 4) The resulting image is 72 dpi You load, resize/resample, and the save, right? So, I suppose you get what you should expect. McSeem __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Gus G. <ag...@gr...> - 2006-07-26 23:23:09
|
What does he mean by DPI? I didn't know BMP stored DPI information. Is the file resized? DPI (Dots Per Inch) is just a label. The real question is: is the image dimension being changed? Is this on purpose? If the image has x pixels by y pixels on entry and it has the same x pixels by y pixels on exit, nothing changed. If the "DPI" he speaks of is different, just change it back what whatever is needed. As I said, it's just a label with no bearing on the actual data. Now, if the image has a smaller x by y pixels on exit, than he is resizing it and the result is what should be expected. g On Jul 26, 2006, at 12:53 PM, Maxim Shemanarev wrote: >> FitToImageSize(m_dImageWidht,m_dImageHeight); > > What does it do? > >> 3) I process it with: > > [. . .] > It also can change the size. > >> 3) I save the buffer with : m_pmap_window.save_as_bmp >> 4) The resulting image is 72 dpi > > You load, resize/resample, and the save, right? So, I suppose you > get what you > should expect. > > McSeem > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn > cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vector-agg-general mailing list > Vec...@li... > https://lists.sourceforge.net/lists/listinfo/vector-agg-general |
|
From: Mikko M. <me...@in...> - 2006-07-28 03:53:28
|
Maxim Shemanarev wrote: >> FitToImageSize(m_dImageWidht,m_dImageHeight); > > What does it do? > >> 3) I process it with: > > [. . .] > It also can change the size. > >> 3) I save the buffer with : m_pmap_window.save_as_bmp >> 4) The resulting image is 72 dpi > > You load, resize/resample, and the save, right? So, I suppose you get what you > should expect. I think you need to store the initial dpi value from the file you load, and the when saving use the same value. Most programs, such as PhotoShop treat images without dpi information as 72dpi image. --mikko |
|
From: Analist <in...@an...> - 2006-07-26 20:34:19
|
Thanxs for the attention,
FitToImageSize(m_dImageWidht,m_dImageHeight);
Stretch the image to fit a rectangle into the center of the screen.
I suppose the resampling is the cause of the loose of dpi, right?
If yes how is possible to retain the original resolution?
Sorry for my question but I am starting now to understand a little of Agg.
Regards
Antonio
"Maxim Shemanarev" <mcs...@ya...> ha scritto nel messaggio
news:200...@we......
>> FitToImageSize(m_dImageWidht,m_dImageHeight);
>
> What does it do?
>
>> 3) I process it with:
>
> [. . .]
> It also can change the size.
>
>> 3) I save the buffer with : m_pmap_window.save_as_bmp
>> 4) The resulting image is 72 dpi
>
> You load, resize/resample, and the save, right? So, I suppose you get what
> you
> should expect.
>
> McSeem
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
|
|
From: Maxim S. <mcs...@ya...> - 2006-07-27 11:50:57
|
> FitToImageSize(m_dImageWidht,m_dImageHeight); > Stretch the image to fit a rectangle into the center of the screen. > > I suppose the resampling is the cause of the loose of dpi, right? > > If yes how is possible to retain the original resolution? > > Sorry for my question but I am starting now to understand a little of Agg. It's not the matter of AGG, it's more general, I suppose. You load a large image and resize it to be fully visible. Then you perform some transformation and save the result. Instead of this you should transform the original image in its coordinate space, and save it. And only for display purposes you make a reduced copy of the result. You should make this copy every time something is changing in the big image. McSeem __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |