Skip to main content
deleted 10 characters in body
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

Bug introduced in 7 or earlier and persisting throughfixed in 12.01
Bug isn't present in version 5.2


Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

Bug introduced in 7 or earlier and persisting through 12.0
Bug isn't present in version 5.2


Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

Bug introduced in 7 or earlier and fixed in 12.1
Bug isn't present in version 5.2


Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

Tweeted twitter.com/StackMma/status/1165504190245953538
edited tags
Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375
added 131 characters in body; edited tags
Source Link
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

Bug introduced in 7 or earlier and persisting through 12.0
Bug isn't present in version 5.2


Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

Bug introduced in 7 or earlier and persisting through 12.0
Bug isn't present in version 5.2


Something about Rasterize which doesn't seem to work as intended.

Recipe:

  1. Make some simple vector graphics:

    Test = Graphics[Circle[{0, 0} 1]]
    
  2. Try to rasterize it having defined ImageSize and ImageResolution:

    TestNew = Rasterize[Test, "Image", ImageResolution -> 300, ImageSize -> 72]
    

    ImageSize set to 72 means that the resulting image should have exactly 1 inch in size on the screen, since screen resolution is 72 pixels per inch. This is okay.

    ImageResolution set 300 means that this image should have dimensions 300 over 300, since ImageResolution is defined in printer dots per inch and the image has the size of one inch.

  3. However, check image dimensions:

    ImageDimensions[TestNew]
    

To discover that it is 72.

Moreover: the result does not depend at all on ImageResolution option. From documentation: "RasterSize and ImageResolution determine the coarseness of rasterization; ImageSize determines the size at which the final image will be displayed." If I vary RasterSize, the coarseness indeed changes. If I vary ImageResolution, the coarseness stays the same.

My system: Ubuntu 14, MMA10.0.1

Questions:

  1. Can anyone reproduce the behaviour? (done; yes)

  2. If it's not a bug, what is the reason? (mostly done: technical reason wonderfully explained by Alexey Popkov; this will be updated after the answer from WRI support is available)

  3. Could someone try this on older MMA versions? (done: See Alexey's comment to his answer: ImageResoltution is overriden by ImageSize in V7, but not in V5)

Edit: The result I would want to obtain in the above example can be obtained by calling:

TestNew = Rasterize[Test, "Image", RasterSize -> 300, ImageSize -> 72]

Or, for general image sizes:

Rasterize[Test, "Image", ImageResolution -> <DESIRED RESOLUTION IN DPI>, ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

should give the same result as:

Rasterize[Test, "Image", RasterSize -> (<DESIRED SIZE IN CENTIMETERS>/2.54)*(<DESIRED RESOLUTION IN DPI>), ImageSize -> (<DESIRED SIZE IN CENTIMETERS>)*(72/2.54)]

In other words, ImageResolution and RasterSize seem to serve the same purpose, but the former one doesn't seem to work as it should.

Status update: According to the feedback from WRI: The question has been acknowledged as an issue. However it is not decided yet, how exactly it is to be resolved.

edited tags
Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k
Loading
New info
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading
:)
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading
New information added
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading
added 32 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading
Update, accounting for existing answers
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading
Further explanation
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading
Source Link
Alexey Bobrick
  • 1.7k
  • 1
  • 14
  • 24
Loading